diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-06 18:48:20 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-06 18:48:20 (GMT) |
commit | e385ba8adb0c77fea20c58c45b966193c23a4570 (patch) | |
tree | 6d1d45f00516af6eda4e4959c730970f37d5c7b9 /src/uscxml | |
parent | e1a31a44c946d58a1b4654e5daa2d10d9c6f881d (diff) | |
download | uscxml-e385ba8adb0c77fea20c58c45b966193c23a4570.zip uscxml-e385ba8adb0c77fea20c58c45b966193c23a4570.tar.gz uscxml-e385ba8adb0c77fea20c58c45b966193c23a4570.tar.bz2 |
Fixed a concurrency related issue
Diffstat (limited to 'src/uscxml')
-rw-r--r-- | src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp index 2fa2877..fbc244a 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGConverter.cpp @@ -502,9 +502,15 @@ void OSGConverter::dumpMatrix(const osg::Matrix& m) { } void OSGConverter::NameRespectingWriteToFile::operator()(const osg::Image& image, const unsigned int context_id) { - bool success = osgDB::writeImageFile(image, _filename); + + bool success = osgDB::writeImageFile(image, _filename + ".tmp"); if (success) { - _converter->reportSuccess(_req); + int err = rename(std::string(_filename + ".tmp").c_str(), _filename.c_str()); + if (err) { + _converter->reportFailure(_req); + } else { + _converter->reportSuccess(_req); + } } else { _converter->reportFailure(_req); } |