Fix g_object warning for creating schedule from trans

When you try and schedule an open transaction like the blank
transaction a dialog warns you and prevents doing so. As a result a
couple of objects were being unrefed which had not be created so add a
test for the objects before being unrefed.
This commit is contained in:
Robert Fewell 2025-01-24 11:07:23 +00:00
parent f6c73b15fb
commit 99f067ffe3

View File

@ -623,9 +623,10 @@ sxftd_destroy( GtkWidget *w, gpointer user_data )
xaccSchedXactionDestroy(sxfti->sx);
sxfti->sx = NULL;
}
g_object_unref(G_OBJECT(sxfti->dense_cal_model));
g_object_unref(G_OBJECT(sxfti->example_cal));
if (sxfti->dense_cal_model)
g_object_unref(G_OBJECT(sxfti->dense_cal_model));
if (sxfti->example_cal)
g_object_unref(G_OBJECT(sxfti->example_cal));
g_free(sxfti);
}