X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fworkarea.cpp;h=fa017e609a125e745d2c2905dbaba423c0f40dcd;hb=9f675b68765a7dac8f29a428152f137d0da46f2b;hp=f9b529d3d9d344e303468cb8a2efc37b0e6d96e7;hpb=409b41a1b5442853d5c0cabecbd070418308584a;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index f9b529d..fa017e6 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -7,6 +7,7 @@ ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** Copyright 2006 Yue Shi Lai +** 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 @@ -806,11 +807,20 @@ WorkArea::~WorkArea() // don't leave the render function queued if we are about to vanish; // that causes crashes if(render_idle_func_id) - { - synfig::info("g_source_remove() returns %d", g_source_remove(render_idle_func_id)); render_idle_func_id=0; - } else - synfig::info("no render_idle_func_id to clear\n"); +} + +bool +WorkArea::get_updating()const +{ + return App::single_threaded && async_renderer && async_renderer->updating; +} + +void +WorkArea::stop_updating(bool cancel) +{ + async_renderer->stop(); + if (cancel) canceled_=true; } void @@ -2177,6 +2187,12 @@ public: bool studio::WorkArea::async_update_preview() { + if (get_updating()) + { + stop_updating(); + return false; + } + async_renderer=0; queued=false;