[beast: 11/15] BSE: provide Bse::objects_debug_leaks()
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 11/15] BSE: provide Bse::objects_debug_leaks()
- Date: Fri, 28 Oct 2016 11:17:34 +0000 (UTC)
commit 388cfe586fa9c5afb2ca11d3621e984f4c53fd16
Author: Tim Janik <timj gnu org>
Date: Thu Oct 27 21:57:08 2016 +0200
BSE: provide Bse::objects_debug_leaks()
Signed-off-by: Tim Janik <timj gnu org>
bse/bseobject.cc | 42 +++++++++++++++++++++---------------------
bse/bseobject.hh | 1 -
bse/bsestartup.hh | 1 +
3 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/bse/bseobject.cc b/bse/bseobject.cc
index 4df911d..dbf60ac 100644
--- a/bse/bseobject.cc
+++ b/bse/bseobject.cc
@@ -48,6 +48,27 @@ ObjectImpl::changed (const String &what)
sig_changed.emit (what);
}
+void
+objects_debug_leaks ()
+{
+ if (Bse::bse_debug_enabled ("leaks"))
+ {
+ GList *list, *objects = bse_objects_list (BSE_TYPE_OBJECT);
+ for (list = objects; list; list = list->next)
+ {
+ BseObject *object = (BseObject*) list->data;
+ LDEBUG ("stale %s:\t prepared=%u locked=%u ref_count=%u id=%u ((BseObject*)%p)",
+ G_OBJECT_TYPE_NAME (object),
+ BSE_IS_SOURCE (object) && BSE_SOURCE_PREPARED (object),
+ object->lock_count > 0,
+ G_OBJECT (object)->ref_count,
+ BSE_OBJECT_ID (object),
+ object);
+ }
+ g_list_free (objects);
+ }
+}
+
} // Bse
enum
@@ -83,27 +104,6 @@ static guint object_signals[SIGNAL_LAST] = { 0, };
/* --- functions --- */
-void
-bse_object_debug_leaks (void)
-{
- if (Bse::bse_debug_enabled ("leaks"))
- {
- GList *list, *objects = bse_objects_list (BSE_TYPE_OBJECT);
- for (list = objects; list; list = list->next)
- {
- BseObject *object = (BseObject*) list->data;
- LDEBUG ("stale %s:\t prepared=%u locked=%u ref_count=%u id=%u ((BseObject*)%p)",
- G_OBJECT_TYPE_NAME (object),
- BSE_IS_SOURCE (object) && BSE_SOURCE_PREPARED (object),
- object->lock_count > 0,
- G_OBJECT (object)->ref_count,
- BSE_OBJECT_ID (object),
- object);
- }
- g_list_free (objects);
- }
-}
-
/**
* @param object supposedly valid #GObject pointer
* @return newly allocated string
diff --git a/bse/bseobject.hh b/bse/bseobject.hh
index 36ec876..af1385d 100644
--- a/bse/bseobject.hh
+++ b/bse/bseobject.hh
@@ -148,7 +148,6 @@ BseObject* bse_object_from_id (guint unique_id);
GList* bse_objects_list (GType type);
GList* bse_objects_list_by_uname (GType type,
const gchar *uname);
-void bse_object_debug_leaks (void);
const gchar* bse_object_debug_name (gpointer object);
gchar* bse_object_strdup_debug_handle (gpointer object);
void bse_object_restore_start (BseObject *object,
diff --git a/bse/bsestartup.hh b/bse/bsestartup.hh
index 4bb5cd7..ca704a4 100644
--- a/bse/bsestartup.hh
+++ b/bse/bsestartup.hh
@@ -25,6 +25,7 @@ public:
SfiGlueContext* init_glue_context (const gchar *client, const std::function<void()> &caller_wakeup);
void init_async (int *argc, char **argv, const char *app_name, const StringVector &args =
StringVector());
bool init_needed ();
+void objects_debug_leaks ();
/// A GSource implementation to attach an Aida::BaseConnection to a Glib main loop.
class AidaGlibSource : public GSource {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]