Put a mutex around Plant::sync() to stop 2 threads running it at the same time. ...
[synfig.git] / synfig-core / trunk / src / modules / mod_particle / plant.cpp
index 7c8d5ac..2a93935 100644 (file)
@@ -102,6 +102,7 @@ Plant::Plant():
        splits=5;
        drag=0.1;
        size=0.015;
+       needs_sync_=true;
        sync();
        size_as_alpha=false;
 }
@@ -174,6 +175,8 @@ Plant::calc_bounding_rect()const
 void
 Plant::sync()const
 {
+       Mutex::Lock lock(mutex);
+       if (!needs_sync_) return;
        particle_list.clear();
 
        bounding_rect=Rect::zero();