Don't delete the preview renderer if it's still running.
[synfig.git] / synfig-studio / trunk / src / gtkmm / preview.cpp
index ce8424f..51d434b 100644 (file)
@@ -6,6 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2007 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -255,7 +256,7 @@ void studio::Preview::frame_finish(const Preview_Target *targ)
        if(!buffer)
                return;
 
-       //convert all the pixles to the pixbuf... buffer... thing...
+       //convert all the pixels to the pixbuf... buffer... thing...
        //synfig::warning("Converting...");
        convert_color_format(buffer, surf[0], surf.get_w()*surf.get_h(), pf, App::gamma);
 
@@ -858,9 +859,10 @@ void studio::Widget_Preview::repreview()
 void studio::Widget_Preview::stoprender()
 {
        if(preview)
-       {
-               preview->renderer.detach();
-       }
+               if (preview->renderer->updating)
+                       preview->renderer->stop();
+               else
+                       preview->renderer.detach();
 }
 
 void studio::Widget_Preview::eraseall()