diff options
| author | MenTaLguY <mental@rydia.net> | 2006-05-01 03:42:42 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2006-05-01 03:42:42 +0000 |
| commit | 3680cfbf130eb9e17fa5a5b57435f1985e380ba8 (patch) | |
| tree | 79fe95fd814b696e01a2eb126d290d55bb277096 /src/libnr/nr-object.cpp | |
| parent | preliminary translated keys.de.xml (diff) | |
| download | inkscape-3680cfbf130eb9e17fa5a5b57435f1985e380ba8.tar.gz inkscape-3680cfbf130eb9e17fa5a5b57435f1985e380ba8.zip | |
log finalization of NRObjects
(bzr r644)
Diffstat (limited to 'src/libnr/nr-object.cpp')
| -rw-r--r-- | src/libnr/nr-object.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libnr/nr-object.cpp b/src/libnr/nr-object.cpp index b18685d11..feffbd884 100644 --- a/src/libnr/nr-object.cpp +++ b/src/libnr/nr-object.cpp @@ -13,9 +13,15 @@ #include <string.h> #include <stdio.h> +#include <typeinfo> + #include <libnr/nr-macros.h> #include "nr-object.h" +#include "debug/event-tracker.h" +#include "debug/simple-event.h" +#include "util/share.h" +#include "util/format.h" unsigned int nr_emit_fail_warning(const gchar *file, unsigned int line, const gchar *method, const gchar *expr) { @@ -150,9 +156,25 @@ static void nr_class_tree_object_invoke_init(NRObjectClass *c, NRObject *object) namespace { +namespace Debug = Inkscape::Debug; +namespace Util = Inkscape::Util; + +typedef Debug::SimpleEvent<Debug::Event::FINALIZERS> BaseFinalizerEvent; + +class FinalizerEvent : public BaseFinalizerEvent { +public: + FinalizerEvent(NRObject *object) + : BaseFinalizerEvent(Util::share_static_string("nr-object-finalizer")) + { + _addProperty("object", Util::format("%p", object)); + _addProperty("class", Util::share_static_string(typeid(*object).name())); + } +}; + void finalize_object(void *base, void *) { NRObject *object = reinterpret_cast<NRObject *>(base); + Debug::EventTracker<FinalizerEvent> tracker(object); object->klass->finalize(object); object->~NRObject(); } |
