X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/848332140be2d53aea32d0702f4c0e06c149d24b..0b6cf205888513d5bffb2cd0c13fcde5cf313168:/include/wx/gtk/private.h diff --git a/include/wx/gtk/private.h b/include/wx/gtk/private.h index 4c6be9b94e..bad72b53f2 100644 --- a/include/wx/gtk/private.h +++ b/include/wx/gtk/private.h @@ -60,6 +60,24 @@ G_END_DECLS extern void wxapp_install_idle_handler(); 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 //-----------------------------------------------------------------------------