Introduce a convenience class for g_freeing a gchar* on scope exit automatically, as suggested by VZ
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c18353e561
commit
35a489dd90
@ -60,6 +60,24 @@ G_END_DECLS
|
|||||||
extern void wxapp_install_idle_handler();
|
extern void wxapp_install_idle_handler();
|
||||||
extern bool g_isIdle;
|
extern bool g_isIdle;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Convenience class for g_freeing a gchar* on scope exit automatically
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxGtkString
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit wxGtkString(gchar *s) : m_str(s) { }
|
||||||
|
~wxGtkString() { g_free(m_str); }
|
||||||
|
|
||||||
|
operator gchar *() const { return m_str; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
gchar *m_str;
|
||||||
|
|
||||||
|
DECLARE_NO_COPY_CLASS(wxGtkString)
|
||||||
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// GTK+ scroll types -> wxEventType
|
// GTK+ scroll types -> wxEventType
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user