r15874 - gnucash/trunk/src/business/business-core - Add a few gncAddressBeginEdit before gncAddressDestroy.
Andreas Köhler
andi5 at cvs.gnucash.org
Wed Apr 11 11:37:10 EDT 2007
Author: andi5
Date: 2007-04-11 11:37:09 -0400 (Wed, 11 Apr 2007)
New Revision: 15874
Trac: http://svn.gnucash.org/trac/changeset/15874
Modified:
gnucash/trunk/src/business/business-core/gncCustomer.c
gnucash/trunk/src/business/business-core/gncEmployee.c
gnucash/trunk/src/business/business-core/gncVendor.c
gnucash/trunk/src/business/business-core/test/test-address.c
Log:
Add a few gncAddressBeginEdit before gncAddressDestroy.
Modified: gnucash/trunk/src/business/business-core/gncCustomer.c
===================================================================
--- gnucash/trunk/src/business/business-core/gncCustomer.c 2007-04-11 15:34:19 UTC (rev 15873)
+++ gnucash/trunk/src/business/business-core/gncCustomer.c 2007-04-11 15:37:09 UTC (rev 15874)
@@ -195,7 +195,9 @@
CACHE_REMOVE (cust->id);
CACHE_REMOVE (cust->name);
CACHE_REMOVE (cust->notes);
+ gncAddressBeginEdit (cust->addr);
gncAddressDestroy (cust->addr);
+ gncAddressBeginEdit (cust->shipaddr);
gncAddressDestroy (cust->shipaddr);
g_list_free (cust->jobs);
@@ -442,7 +444,10 @@
if(!cust || !addr_ent) { return; }
addr = (GncAddress*)addr_ent;
if(addr == cust->addr) { return; }
- if(cust->addr != NULL) { gncAddressDestroy(cust->addr); }
+ if(cust->addr != NULL) {
+ gncAddressBeginEdit(cust->addr);
+ gncAddressDestroy(cust->addr);
+ }
gncCustomerBeginEdit(cust);
cust->addr = addr;
gncCustomerCommitEdit(cust);
@@ -456,7 +461,10 @@
if(!cust || !ship_addr_ent) { return; }
ship_addr = (GncAddress*)ship_addr_ent;
if(ship_addr == cust->shipaddr) { return; }
- if(cust->shipaddr != NULL) { gncAddressDestroy(cust->shipaddr); }
+ if(cust->shipaddr != NULL) {
+ gncAddressBeginEdit(cust->shipaddr);
+ gncAddressDestroy(cust->shipaddr);
+ }
gncCustomerBeginEdit(cust);
cust->shipaddr = ship_addr;
gncCustomerCommitEdit(cust);
Modified: gnucash/trunk/src/business/business-core/gncEmployee.c
===================================================================
--- gnucash/trunk/src/business/business-core/gncEmployee.c 2007-04-11 15:34:19 UTC (rev 15873)
+++ gnucash/trunk/src/business/business-core/gncEmployee.c 2007-04-11 15:37:09 UTC (rev 15874)
@@ -130,6 +130,7 @@
CACHE_REMOVE (employee->username);
CACHE_REMOVE (employee->language);
CACHE_REMOVE (employee->acl);
+ gncAddressBeginEdit (employee->addr);
gncAddressDestroy (employee->addr);
/* qof_instance_release (&employee->inst); */
@@ -287,7 +288,10 @@
if(!employee || !addr_ent) { return; }
addr = (GncAddress*)addr_ent;
if(addr == employee->addr) { return; }
- if(employee->addr != NULL) { gncAddressDestroy(employee->addr); }
+ if(employee->addr != NULL) {
+ gncAddressBeginEdit(employee->addr);
+ gncAddressDestroy(employee->addr);
+ }
gncEmployeeBeginEdit(employee);
employee->addr = addr;
gncEmployeeCommitEdit(employee);
Modified: gnucash/trunk/src/business/business-core/gncVendor.c
===================================================================
--- gnucash/trunk/src/business/business-core/gncVendor.c 2007-04-11 15:34:19 UTC (rev 15873)
+++ gnucash/trunk/src/business/business-core/gncVendor.c 2007-04-11 15:37:09 UTC (rev 15874)
@@ -134,6 +134,7 @@
CACHE_REMOVE (vendor->id);
CACHE_REMOVE (vendor->name);
CACHE_REMOVE (vendor->notes);
+ gncAddressBeginEdit (vendor->addr);
gncAddressDestroy (vendor->addr);
g_list_free (vendor->jobs);
@@ -322,7 +323,10 @@
if(!vendor || !addr_ent) { return; }
addr = (GncAddress*)addr_ent;
if(addr == vendor->addr) { return; }
- if(vendor->addr != NULL) { gncAddressDestroy(vendor->addr); }
+ if(vendor->addr != NULL) {
+ gncAddressBeginEdit(vendor->addr);
+ gncAddressDestroy(vendor->addr);
+ }
gncVendorBeginEdit(vendor);
vendor->addr = addr;
gncVendorCommitEdit(vendor);
Modified: gnucash/trunk/src/business/business-core/test/test-address.c
===================================================================
--- gnucash/trunk/src/business/business-core/test/test-address.c 2007-04-11 15:34:19 UTC (rev 15873)
+++ gnucash/trunk/src/business/business-core/test/test-address.c 2007-04-11 15:37:09 UTC (rev 15874)
@@ -52,6 +52,7 @@
address = gncAddressCreate (book, &ent);
do_test (address != NULL, "address create");
+ gncAddressBeginEdit (address);
gncAddressDestroy (address);
success ("create/destroy");
}
More information about the gnucash-changes
mailing list