diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2010-12-06 08:21:18 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2010-12-06 08:21:18 +0000 |
| commit | 75684fbe34e2f04c36f9e5ad7e7931286e755d38 (patch) | |
| tree | 3efa386abfb1817e94e305fdcd353d0313d29d65 /src | |
| parent | Restore copies of renamed icons on certain gtk versions. Fixes bug #651678. (diff) | |
| download | inkscape-75684fbe34e2f04c36f9e5ad7e7931286e755d38.tar.gz inkscape-75684fbe34e2f04c36f9e5ad7e7931286e755d38.zip | |
Stop background rendering once crash handler is triggered.
(bzr r9940)
Diffstat (limited to 'src')
| -rw-r--r-- | src/inkscape.cpp | 9 | ||||
| -rw-r--r-- | src/inkscape.h | 2 | ||||
| -rw-r--r-- | src/widgets/icon.cpp | 11 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 8b31ba267..e4edb9d10 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -553,6 +553,13 @@ inkscape_deactivate_desktop_private (Inkscape::Application */*inkscape*/, SPDesk #define SP_INDENT 8 +static bool crashIsHappening = false; + +bool inkscapeIsCrashing() +{ + return crashIsHappening; +} + static void inkscape_crash_handler (int /*signum*/) { @@ -580,6 +587,8 @@ inkscape_crash_handler (int /*signum*/) } recursion = TRUE; + crashIsHappening = true; + EventTracker<SimpleEvent<Inkscape::Debug::Event::CORE> > tracker("crash"); tracker.set<SimpleEvent<> >("emergency-save"); diff --git a/src/inkscape.h b/src/inkscape.h index d9de54782..64cee1560 100644 --- a/src/inkscape.h +++ b/src/inkscape.h @@ -43,6 +43,8 @@ Inkscape::XML::Node *inkscape_get_menus (Inkscape::Application * inkscape); Inkscape::Application *inkscape_get_instance(); gboolean inkscape_use_gui(); +bool inkscapeIsCrashing(); + SPDesktop * inkscape_find_desktop_by_dkey (unsigned int dkey); #define SP_ACTIVE_EVENTCONTEXT inkscape_active_event_context () diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index f9d01113e..c25e6aac2 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -219,7 +219,7 @@ void sp_icon_fetch_pixbuf( SPIcon *icon ) } } -static GdkPixbuf* renderup( gchar const* name, Inkscape::IconSize lsize, unsigned psize ) { +GdkPixbuf* renderup( gchar const* name, Inkscape::IconSize lsize, unsigned psize ) { GtkIconTheme *theme = gtk_icon_theme_get_default(); GdkPixbuf *pb = 0; @@ -1184,7 +1184,8 @@ void Inkscape::queueIconPrerender( Glib::ustring const &name, Inkscape::IconSize { GtkStockItem stock; gboolean stockFound = gtk_stock_lookup( name.c_str(), &stock ); - if (!stockFound && !gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), name.c_str()) ) { + gboolean themedFound = gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), name.c_str()); + if (!stockFound && !themedFound ) { gint trySize = CLAMP( static_cast<gint>(lsize), 0, static_cast<gint>(G_N_ELEMENTS(iconSizeLookup) - 1) ); if ( !sizeMapDone ) { injectCustomSize(); @@ -1349,7 +1350,9 @@ static void addPreRender( GtkIconSize lsize, gchar const *name ) } gboolean icon_prerender_task(gpointer /*data*/) { - if (!pendingRenders.empty()) { + if ( inkscapeIsCrashing() ) { + // stop + } else if (!pendingRenders.empty()) { bool workDone = false; do { preRenderItem single = pendingRenders.front(); @@ -1359,7 +1362,7 @@ gboolean icon_prerender_task(gpointer /*data*/) { } while (!pendingRenders.empty() && !workDone); } - if (!pendingRenders.empty()) { + if (!inkscapeIsCrashing() && !pendingRenders.empty()) { return TRUE; } else { callbackHooked = false; |
