mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 796981 - Gnucash crashes with critical error when selecting another file
The problem is that if the currently open file has a report tab with another tab to its right and selected then when the selected tab is closed by the shutdown code Gtk sends a "realize" signal to the report page. That sets an idle event to gnc_plugin_page_report_load_uri, but the shutdown code proceeds to destroy the page and GnuCash has loaded the new session before the idle event fires. By that time there's no page so GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE naturally returns NULL and the first dereference crashes. I couldn't find an easy way to avoid queuing the idle so I opted to protect the function from the NULL priv.
This commit is contained in:
parent
294c932e3b
commit
4585f60dd9
@ -393,8 +393,9 @@ gnc_plugin_page_report_load_uri (GncPluginPage *page)
|
|||||||
|
|
||||||
report = GNC_PLUGIN_PAGE_REPORT(page);
|
report = GNC_PLUGIN_PAGE_REPORT(page);
|
||||||
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
|
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
|
||||||
|
if (!priv)
|
||||||
|
return FALSE; // No priv means the page doesn't exist anymore.
|
||||||
|
|
||||||
// FIXME. This is f^-1(f(x)), isn't it?
|
|
||||||
DEBUG( "Load uri id=%d", priv->reportId );
|
DEBUG( "Load uri id=%d", priv->reportId );
|
||||||
id_name = g_strdup_printf("id=%d", priv->reportId );
|
id_name = g_strdup_printf("id=%d", priv->reportId );
|
||||||
child_name = gnc_build_url( URL_TYPE_REPORT, id_name, NULL );
|
child_name = gnc_build_url( URL_TYPE_REPORT, id_name, NULL );
|
||||||
|
Loading…
Reference in New Issue
Block a user