fix memory leak, closes #15785

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75490 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2013-12-29 19:14:24 +00:00
parent 66b03f12eb
commit 16ad55c469
2 changed files with 6 additions and 2 deletions

View File

@@ -593,6 +593,7 @@ All (GUI):
wxGTK: wxGTK:
- Fix mouse wheel scrolling in wxListCtrl broken just before 3.0.0. - Fix mouse wheel scrolling in wxListCtrl broken just before 3.0.0.
- Fix memory leak in wxSocket
wxMSW: wxMSW:

View File

@@ -46,11 +46,14 @@ class GTKFDIOManager : public wxFDIOManager
public: public:
virtual int AddInput(wxFDIOHandler *handler, int fd, Direction d) virtual int AddInput(wxFDIOHandler *handler, int fd, Direction d)
{ {
return g_io_add_watch( GIOChannel* channel = g_io_channel_unix_new(fd);
g_io_channel_unix_new(fd), unsigned id = g_io_add_watch(
channel,
d == OUTPUT ? G_IO_OUT : G_IO_IN, d == OUTPUT ? G_IO_OUT : G_IO_IN,
wxSocket_Input, wxSocket_Input,
handler); handler);
g_io_channel_unref(channel);
return id;
} }
virtual void virtual void