summaryrefslogtreecommitdiff
path: root/glib/glibmm/wrap.h
diff options
context:
space:
mode:
Diffstat (limited to 'glib/glibmm/wrap.h')
-rw-r--r--glib/glibmm/wrap.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/glib/glibmm/wrap.h b/glib/glibmm/wrap.h
index 94f17263..e7988abb 100644
--- a/glib/glibmm/wrap.h
+++ b/glib/glibmm/wrap.h
@@ -78,9 +78,15 @@ TInterface* wrap_auto_interface(GObject* object, bool take_copy = false)
//so we at least get the expected type:
TInterface* result = 0;
if(pCppObject)
- result = dynamic_cast<TInterface*>(pCppObject);
+ {
+ result = dynamic_cast<TInterface*>(pCppObject);
+ if(!result)
+ {
+ g_warning("Glib::wrap_auto_interface(): The C++ instance (%s) does not dynamic_cast to the interface.\n", typeid(*pCppObject).name());
+ }
+ }
else
- result = new TInterface((typename TInterface::BaseObjectType*)object);
+ result = new TInterface((typename TInterface::BaseObjectType*)object);
// take_copy=true is used where the GTK+ function doesn't do
// an extra ref for us, and always for plain struct members.