glibmm r774 - in trunk: . glib/glibmm
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: glibmm r774 - in trunk: . glib/glibmm
- Date: Fri, 9 Jan 2009 15:32:34 +0000 (UTC)
Author: murrayc
Date: Fri Jan 9 15:32:34 2009
New Revision: 774
URL: http://svn.gnome.org/viewvc/glibmm?rev=774&view=rev
Log:
2009-01-09 Murray Cumming <murrayc murrayc com>
* glib/glibmm/wrap.h: wrap_auto_interface<>(): Add a warning to give a
clue when the dynamic_cast fails, for instance if you are doing some
incorrect multiple inheritance.
Modified:
trunk/ChangeLog
trunk/glib/glibmm/wrap.h
Modified: trunk/glib/glibmm/wrap.h
==============================================================================
--- trunk/glib/glibmm/wrap.h (original)
+++ trunk/glib/glibmm/wrap.h Fri Jan 9 15:32:34 2009
@@ -78,9 +78,15 @@
//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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]