r15827 - gnucash/branches/gobject-engine-dev-warlord - Add hooks for the gobject dispose() function so that we can

Derek Atkins warlord at cvs.gnucash.org
Wed Apr 4 23:10:28 EDT 2007


Author: warlord
Date: 2007-04-04 23:10:26 -0400 (Wed, 04 Apr 2007)
New Revision: 15827
Trac: http://svn.gnucash.org/trac/changeset/15827

Modified:
   gnucash/branches/gobject-engine-dev-warlord/
   gnucash/branches/gobject-engine-dev-warlord/lib/libqof/qof/qof-gobject.h
   gnucash/branches/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncAddress.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncBillTerm.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncCustomer.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncEntry.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncInvoice.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncJob.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncOrder.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncTaxTable.c
   gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncVendor.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/Account.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/FreqSpec.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/SX-book.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/SchedXaction.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/Split.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/Transaction.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-budget.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-commodity.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-lot.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/test/test-book-merge.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/test/test-recursive.c
Log:
Add hooks for the gobject dispose() function so that we can
migrate each object's "free()" function to a combination of
dispose() and finalize().
(and yes, "make check" still passes all its tests)



Property changes on: gnucash/branches/gobject-engine-dev-warlord
___________________________________________________________________
Name: svk:merge
   - 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/swig-redo:802
3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:1037
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord:14369
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord1:14431
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:14282
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk2:13366
   + 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/swig-redo:802
3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:1037
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord:14369
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord1:14446
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:14282
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk2:13366

Modified: gnucash/branches/gobject-engine-dev-warlord/lib/libqof/qof/qof-gobject.h
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/lib/libqof/qof/qof-gobject.h	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/lib/libqof/qof/qof-gobject.h	2007-04-05 03:10:26 UTC (rev 15827)
@@ -57,16 +57,26 @@
  */
 
 #define QOF_GOBJECT_GET_TYPE(TypeName, type_name, TYPE_PARENT, CODE)	\
-  static void type_name##_finalize(GObject *object);			\
   G_DEFINE_TYPE_WITH_CODE(TypeName, type_name, TYPE_PARENT, CODE);
 
 #define QOF_GOBJECT_CLASS_INIT(type_name, TypeName)			\
+  static void type_name##_dispose(GObject *object);			\
+  static void type_name##_finalize(GObject *object);			\
   static void type_name##_class_init(TypeName##Class *klass)		\
   {									\
     GObjectClass *object_class = G_OBJECT_CLASS(klass);			\
+    object_class->dispose = type_name##_dispose;			\
     object_class->finalize = type_name##_finalize;			\
   }
 
+#define QOF_GOBJECT_DISPOSE(type_name)					\
+  static void type_name##_dispose_real(GObject* object);		\
+  static void type_name##_dispose(GObject *object)			\
+  {									\
+    type_name##_dispose_real(object);					\
+    G_OBJECT_CLASS(type_name##_parent_class)->dispose(object);		\
+  }
+
 #define QOF_GOBJECT_FINALIZE(type_name)					\
   static void type_name##_finalize_real(GObject* object);		\
   static void type_name##_finalize(GObject *object)			\
@@ -78,6 +88,7 @@
 #define QOF_GOBJECT_IMPL_WITH_CODE(type_name, TypeName, TYPE_PARENT, CODE) \
   QOF_GOBJECT_GET_TYPE(TypeName, type_name, TYPE_PARENT, CODE);		\
   QOF_GOBJECT_CLASS_INIT(type_name, TypeName);				\
+  QOF_GOBJECT_DISPOSE(type_name);					\
   QOF_GOBJECT_FINALIZE(type_name);
 
 #define QOF_GOBJECT_IMPL(type_name, TypeName, TYPE_PARENT) \

Modified: gnucash/branches/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -103,6 +103,11 @@
 }
 
 static void
+qof_book_dispose_real (GObject *bookp)
+{
+}
+
+static void
 qof_book_finalize_real (GObject *bookp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncAddress.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncAddress.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncAddress.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -76,6 +76,11 @@
 }
 
 static void
+gnc_address_dispose_real (GObject *addrp)
+{
+}
+
+static void
 gnc_address_finalize_real(GObject* addrp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncBillTerm.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncBillTerm.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncBillTerm.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -142,6 +142,11 @@
 }
 
 static void
+gnc_billterm_dispose_real (GObject *btp)
+{
+}
+
+static void
 gnc_billterm_finalize_real(GObject* btp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncCustomer.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncCustomer.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncCustomer.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -98,6 +98,11 @@
 }
 
 static void
+gnc_customer_dispose_real (GObject *custp)
+{
+}
+
+static void
 gnc_customer_finalize_real(GObject* custp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -80,6 +80,11 @@
 }
 
 static void
+gnc_employee_dispose_real (GObject *empp)
+{
+}
+
+static void
 gnc_employee_finalize_real(GObject* empp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncEntry.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncEntry.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncEntry.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -187,6 +187,11 @@
 }
 
 static void
+gnc_entry_dispose_real (GObject *entryp)
+{
+}
+
+static void
 gnc_entry_finalize_real(GObject* entryp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncInvoice.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncInvoice.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncInvoice.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -114,6 +114,11 @@
 }
 
 static void
+gnc_invoice_dispose_real (GObject *invp)
+{
+}
+
+static void
 gnc_invoice_finalize_real(GObject* invp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncJob.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncJob.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncJob.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -75,6 +75,11 @@
 }
 
 static void
+gnc_job_dispose_real (GObject *jobp)
+{
+}
+
+static void
 gnc_job_finalize_real(GObject* jobp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncOrder.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncOrder.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncOrder.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -89,6 +89,11 @@
 }
 
 static void
+gnc_order_dispose_real (GObject *orderp)
+{
+}
+
+static void
 gnc_order_finalize_real(GObject* orderp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncTaxTable.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncTaxTable.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncTaxTable.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -214,6 +214,11 @@
 }
 
 static void
+gnc_taxtable_dispose_real (GObject *ttp)
+{
+}
+
+static void
 gnc_taxtable_finalize_real(GObject* ttp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncVendor.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncVendor.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/business/business-core/gncVendor.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -86,6 +86,11 @@
 }
 
 static void
+gnc_vendor_dispose_real (GObject *vendorp)
+{
+}
+
+static void
 gnc_vendor_finalize_real(GObject* vendorp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/Account.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/Account.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/Account.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -117,6 +117,11 @@
 }
 
 static void
+gnc_account_dispose_real (GObject *acctp)
+{
+}
+
+static void
 gnc_account_finalize_real(GObject* acctp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/FreqSpec.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/FreqSpec.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/FreqSpec.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -167,6 +167,11 @@
 }
 
 static void
+gnc_freqspec_dispose_real (GObject *fsp)
+{
+}
+
+static void
 gnc_freqspec_finalize_real(GObject* fsp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/SX-book.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/SX-book.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/SX-book.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -218,16 +218,21 @@
 QOF_GOBJECT_IMPL(gnc_schedxactions, SchedXactions, QOF_TYPE_INSTANCE);
 
 static void
-gnc_schedxactions_init(SchedXactions* fs)
+gnc_schedxactions_init(SchedXactions* sxs)
 {
 }
 
 static void
-gnc_schedxactions_finalize_real(GObject* fsp)
+gnc_schedxactions_dispose_real (GObject *sxsp)
 {
 }
 
 static void
+gnc_schedxactions_finalize_real(GObject* sxsp)
+{
+}
+
+static void
 mark_sx_clean(gpointer data, gpointer user_data)
 {
   SchedXaction *sx = (SchedXaction *) data;

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/SchedXaction.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/SchedXaction.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/SchedXaction.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -49,16 +49,21 @@
 QOF_GOBJECT_IMPL(gnc_schedxaction, SchedXaction, QOF_TYPE_INSTANCE);
 
 static void
-gnc_schedxaction_init(SchedXaction* fs)
+gnc_schedxaction_init(SchedXaction* sx)
 {
 }
 
 static void
-gnc_schedxaction_finalize_real(GObject* fsp)
+gnc_schedxaction_dispose_real (GObject *sxp)
 {
 }
 
 static void
+gnc_schedxaction_finalize_real(GObject* sxp)
+{
+}
+
+static void
 xaccSchedXactionInit(SchedXaction *sx, QofBook *book)
 {
    Account        *ra;

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/Split.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/Split.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/Split.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -59,15 +59,20 @@
 QOF_GOBJECT_IMPL(gnc_split, Split, QOF_TYPE_INSTANCE);
 
 static void
-gnc_split_init(Split* acc)
+gnc_split_init(Split* split)
 {
 }
 
 static void
-gnc_split_finalize_real(GObject* acctp)
+gnc_split_dispose_real (GObject *splitp)
 {
 }
 
+static void
+gnc_split_finalize_real(GObject* splitp)
+{
+}
+
 /********************************************************************\
  * xaccInitSplit
  * Initialize a Split structure

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/Transaction.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/Transaction.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/Transaction.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -239,6 +239,11 @@
 }
 
 static void
+gnc_transaction_dispose_real (GObject *txnp)
+{
+}
+
+static void
 gnc_transaction_finalize_real(GObject* txnp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-budget.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-budget.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-budget.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -62,6 +62,11 @@
 }
 
 static void
+gnc_budget_dispose_real (GObject *budgetp)
+{
+}
+
+static void
 gnc_budget_finalize_real(GObject* budgetp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-commodity.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-commodity.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-commodity.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -542,6 +542,11 @@
 }
 
 static void
+gnc_commodity_dispose_real (GObject *nsp)
+{
+}
+
+static void
 gnc_commodity_finalize_real(GObject* comp)
 {
 }
@@ -1542,6 +1547,11 @@
 }
 
 static void
+gnc_commodity_namespace_dispose_real (GObject *nsp)
+{
+}
+
+static void
 gnc_commodity_namespace_finalize_real(GObject* nsp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-lot.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-lot.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-lot.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -61,6 +61,11 @@
 }
 
 static void
+gnc_lot_dispose_real (GObject *lotp)
+{
+}
+
+static void
 gnc_lot_finalize_real(GObject* lotp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -44,6 +44,11 @@
 }
 
 static void
+gnc_price_dispose_real (GObject *pricep)
+{
+}
+
+static void
 gnc_price_finalize_real(GObject* pricep)
 {
 }
@@ -576,6 +581,11 @@
 }
 
 static void
+gnc_pricedb_dispose_real (GObject *pdbp)
+{
+}
+
+static void
 gnc_pricedb_finalize_real(GObject* pdbp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/test/test-book-merge.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/test/test-book-merge.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/test/test-book-merge.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -108,6 +108,11 @@
 }
 
 static void
+gnc_myobj_dispose_real (GObject *objp)
+{
+}
+
+static void
 gnc_myobj_finalize_real(GObject* objp)
 {
 }

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/test/test-recursive.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/test/test-recursive.c	2007-04-05 02:44:47 UTC (rev 15826)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/test/test-recursive.c	2007-04-05 03:10:26 UTC (rev 15827)
@@ -230,6 +230,11 @@
 }
 
 static void
+gnc_mychild_dispose_real (GObject *objp)
+{
+}
+
+static void
 gnc_mychild_finalize_real(GObject* objp)
 {
 }
@@ -243,6 +248,11 @@
 }
 
 static void
+gnc_myparent_dispose_real (GObject *objp)
+{
+}
+
+static void
 gnc_myparent_finalize_real(GObject* objp)
 {
 }
@@ -256,6 +266,11 @@
 }
 
 static void
+gnc_mygrand_dispose_real (GObject *objp)
+{
+}
+
+static void
 gnc_mygrand_finalize_real(GObject* objp)
 {
 }



More information about the gnucash-changes mailing list