CLASSINFO && Unicode Issue
Bryan Bulten <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I've added the rest of the sizer classes. In doing so, I found that
my original method of grabbing a class name wasn't working correctly,
due to a bad conversion of wxChar* to char*.
To resolve this, I've added CLASSNAME and OBJECTNAME macros to do the
conversion. The main problem with these (below) is that they use strdup
to create space off the stack for passing the return value; which is
probably a memory leak (not sure if mono is responsible for
deallocating.)
Macros are as follows:
#define CLASSNAME(name) \
(strdup((const char*)wxString( \
CLASSINFO(name)->GetClassName()).mb_str()))
#define OBJECTNAME(name) \
(strdup((const char*)wxString( \
obj->GetClassInfo()->GetClassName()).mb_str())
So basically I'm asking if one of the following is possible:
1. Is there a way to do the conversion without allocating this
memory?
2. Is there a way to deallocate this memory from mono (or does the GC
already do so?
Any help would be appreciated.
--
Bryan Bulten
http://opendev.ods.org/
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+fj3/32WFWIzmzHgRArc8AJ9EOoKj2nueCp8TA9Ub/D3SLm+FXACfeIxl WfWMn4lscj9oaId4eXV05dk= =S6/t -----END PGP SIGNATURE-----