Fix 1835429: crash closing preview window before using it.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 24 Nov 2007 12:53:07 +0000 (12:53 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 24 Nov 2007 12:53:07 +0000 (12:53 +0000)
git-svn-id: http://svn.voria.com/code@1164 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/preview.cpp

index 4f5bef1..3ab8dfa 100644 (file)
@@ -861,15 +861,17 @@ void studio::Widget_Preview::repreview()
 
 void studio::Widget_Preview::stoprender()
 {
-       // don't crash if the render has already been stopped
-       if (!preview->renderer)
-               return;
-
        if(preview)
+       {
+               // don't crash if the render has already been stopped
+               if (!preview->renderer)
+                       return;
+
                if (preview->renderer->updating)
                        preview->renderer->stop();
                else
                        preview->renderer.detach();
+       }
 }
 
 void studio::Widget_Preview::eraseall()