GnuCash
5.6-150-g038405b370+
|
Files | |
file | gnc-gobject-utils.h |
Gobject helper routines. | |
Gobject Tracking Functions | |
This set of functions is used to maintain a "database" of objects that are built on top of a GObject (any level of nesting). This database is simply a hash table of lists. The hash table takes the object name as its key and returns a list of all objects of that type. The object is then added to, deleted from, or looked up in the list. The database can also be queried for a list of all objects of a specified type. This can be used to find pre-existing GncTreeModels, etc. (In this case performing a search for a specific object wouldn't help because the information being inspected is private to the object.) Any object added to this database during the execution of gnucash should be deleted from it before completion of the program. WHen the program shuts down, a list of all objects still in the database will be dumped out to the logfile. This should help developers find memory leaks in their code where an object is lost, or is not release because it gained an extra reference at some point during its lifetime. | |
void | gnc_gobject_tracking_remember (GObject *object) |
Tell gnucash to remember this object in the database. More... | |
void | gnc_gobject_tracking_forget (GObject *object) |
Tell gnucash to drop this object from the database. More... | |
const GList * | gnc_gobject_tracking_get_list (const gchar *name) |
Get a list of all known objects of a specified type. More... | |
void | gnc_gobject_tracking_dump (void) |
Dump the entire object tracking database via the g_log() family of functions. More... | |
void gnc_gobject_tracking_dump | ( | void | ) |
Dump the entire object tracking database via the g_log() family of functions.
This function is only called when gnucash exits, and at that point all of the objects should have been removed from the database and freed. Any object remaining is the result of a memory/object leakage.
Definition at line 104 of file gnc-gobject-utils.c.
void gnc_gobject_tracking_forget | ( | GObject * | object | ) |
Tell gnucash to drop this object from the database.
object | The object to be dropped. |
Tell gnucash to drop this object from the database.
Definition at line 194 of file gnc-gobject-utils.c.
const GList* gnc_gobject_tracking_get_list | ( | const gchar * | name | ) |
Get a list of all known objects of a specified type.
name | The type name of the objects to be found. This is the name used when the object type was initialized. If unknown, it can be found by calling G_OBJECT_TYPE_NAME(object). |
Definition at line 220 of file gnc-gobject-utils.c.
void gnc_gobject_tracking_remember | ( | GObject * | object | ) |
Tell gnucash to remember this object in the database.
object | The fully constructed object to be tracked. |
Definition at line 123 of file gnc-gobject-utils.c.