Code

rearrange code to make rubberband a bit more interruptibility-proof
authorbuliabyak <buliabyak@users.sourceforge.net>
Wed, 22 Nov 2006 00:51:59 +0000 (00:51 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Wed, 22 Nov 2006 00:51:59 +0000 (00:51 +0000)
src/rubberband.cpp

index 9ada46f523a40818825f0e05d881590db962ac27..0de3cd763a7dd99b8a98b49014b2947b060b2c80 100644 (file)
@@ -38,13 +38,14 @@ void Inkscape::Rubberband::start(SPDesktop *d, NR::Point const &p)
 
 void Inkscape::Rubberband::stop()
 {
+    _started = false;
+
     if (_canvas) {
-        gtk_object_destroy((GtkObject *) _canvas);
+        GtkObject *temp = _canvas;
         _canvas = NULL;
+        gtk_object_destroy(temp);
         sp_canvas_end_forced_full_redraws(_desktop->canvas);
     }
-    
-    _started = false;
 }
 
 void Inkscape::Rubberband::move(NR::Point const &p)