mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-26 02:40:43 -06:00
Wrap BillTermDecRef and TaxTableDecRef in test for shutdown
When Gnucash is shutting down, the TaxTables and BillTerms will be destroyed/freed and may already have been so there is no point trying to decrement a reference that is used to stop them being destroyed if in use.
This commit is contained in:
parent
b421b3d2af
commit
6a9ff287cd
@ -358,11 +358,12 @@ static void gncCustomerFree (GncCustomer *cust)
|
||||
g_list_free (cust->jobs);
|
||||
g_free (cust->balance);
|
||||
|
||||
if (cust->terms)
|
||||
gncBillTermDecRef (cust->terms);
|
||||
if (cust->taxtable)
|
||||
if (!qof_book_shutting_down (qof_instance_get_book (QOF_INSTANCE(cust))))
|
||||
{
|
||||
gncTaxTableDecRef (cust->taxtable);
|
||||
if (cust->terms)
|
||||
gncBillTermDecRef (cust->terms);
|
||||
if (cust->taxtable)
|
||||
gncTaxTableDecRef (cust->taxtable);
|
||||
}
|
||||
|
||||
/* qof_instance_release (&cust->inst); */
|
||||
|
@ -462,10 +462,14 @@ static void gncEntryFree (GncEntry *entry)
|
||||
gncAccountValueDestroy (entry->i_tax_values);
|
||||
if (entry->b_tax_values)
|
||||
gncAccountValueDestroy (entry->b_tax_values);
|
||||
if (entry->i_tax_table)
|
||||
gncTaxTableDecRef (entry->i_tax_table);
|
||||
if (entry->b_tax_table)
|
||||
gncTaxTableDecRef (entry->b_tax_table);
|
||||
|
||||
if (!qof_book_shutting_down (qof_instance_get_book (QOF_INSTANCE(entry))))
|
||||
{
|
||||
if (entry->i_tax_table)
|
||||
gncTaxTableDecRef (entry->i_tax_table);
|
||||
if (entry->b_tax_table)
|
||||
gncTaxTableDecRef (entry->b_tax_table);
|
||||
}
|
||||
|
||||
/* qof_instance_release (&entry->inst); */
|
||||
g_object_unref (entry);
|
||||
|
@ -423,10 +423,14 @@ static void gncInvoiceFree (GncInvoice *invoice)
|
||||
g_list_free (invoice->entries);
|
||||
g_list_free (invoice->prices);
|
||||
|
||||
if (invoice->printname) g_free (invoice->printname);
|
||||
if (invoice->printname)
|
||||
g_free (invoice->printname);
|
||||
|
||||
if (invoice->terms)
|
||||
gncBillTermDecRef (invoice->terms);
|
||||
if (!qof_book_shutting_down (qof_instance_get_book (QOF_INSTANCE(invoice))))
|
||||
{
|
||||
if (invoice->terms)
|
||||
gncBillTermDecRef (invoice->terms);
|
||||
}
|
||||
|
||||
/* qof_instance_release (&invoice->inst); */
|
||||
g_object_unref (invoice);
|
||||
|
@ -501,10 +501,13 @@ static void gncVendorFree (GncVendor *vendor)
|
||||
g_list_free (vendor->jobs);
|
||||
g_free (vendor->balance);
|
||||
|
||||
if (vendor->terms)
|
||||
gncBillTermDecRef (vendor->terms);
|
||||
if (vendor->taxtable)
|
||||
gncTaxTableDecRef (vendor->taxtable);
|
||||
if (!qof_book_shutting_down (qof_instance_get_book (QOF_INSTANCE(vendor))))
|
||||
{
|
||||
if (vendor->terms)
|
||||
gncBillTermDecRef (vendor->terms);
|
||||
if (vendor->taxtable)
|
||||
gncTaxTableDecRef (vendor->taxtable);
|
||||
}
|
||||
|
||||
/* qof_instance_release (&vendor->inst); */
|
||||
g_object_unref (vendor);
|
||||
|
Loading…
Reference in New Issue
Block a user