mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Free Jobs for Customers and Vendors on book close
This commit is contained in:
parent
c2a6f1e911
commit
b421b3d2af
@ -353,6 +353,8 @@ static void gncCustomerFree (GncCustomer *cust)
|
||||
gncAddressDestroy (cust->addr);
|
||||
gncAddressBeginEdit (cust->shipaddr);
|
||||
gncAddressDestroy (cust->shipaddr);
|
||||
|
||||
gncJobFreeList (cust->jobs);
|
||||
g_list_free (cust->jobs);
|
||||
g_free (cust->balance);
|
||||
|
||||
|
@ -231,6 +231,18 @@ GncJob *gncJobCreate (QofBook *book)
|
||||
return job;
|
||||
}
|
||||
|
||||
static void free_job_list (GncJob *job)
|
||||
{
|
||||
gncJobBeginEdit (job);
|
||||
gncJobDestroy (job);
|
||||
}
|
||||
|
||||
void gncJobFreeList (GList *jobs)
|
||||
{
|
||||
GList *job_list = g_list_copy (jobs);
|
||||
g_list_free_full (job_list, (GDestroyNotify)free_job_list);
|
||||
}
|
||||
|
||||
void gncJobDestroy (GncJob *job)
|
||||
{
|
||||
if (!job) return;
|
||||
|
@ -57,6 +57,7 @@ GType gnc_job_get_type(void);
|
||||
|
||||
GncJob *gncJobCreate (QofBook *book);
|
||||
void gncJobDestroy (GncJob *job);
|
||||
void gncJobFreeList (GList *jobs);
|
||||
|
||||
/** \name Set Functions
|
||||
@{
|
||||
|
@ -496,6 +496,8 @@ static void gncVendorFree (GncVendor *vendor)
|
||||
CACHE_REMOVE (vendor->notes);
|
||||
gncAddressBeginEdit (vendor->addr);
|
||||
gncAddressDestroy (vendor->addr);
|
||||
|
||||
gncJobFreeList (vendor->jobs);
|
||||
g_list_free (vendor->jobs);
|
||||
g_free (vendor->balance);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user