I seem to have uncovered a leak in wxCheckListBox (running in XP). I'd really appreciate it if others could run this code to confirm.
I'm getting a steady 20K leak in task manager - with the GCMemAlloced() printout looking fine.
Worse, if I comment out Clear() and uncomment the DeleteItem() code the leak remains, and the app auto-exits to desktop with nary a complaint after 250 iterations! Most unsettling...
All help much appreciated! Perhaps there's something wrong with my code?
I'm getting a steady 20K leak in task manager - with the GCMemAlloced() printout looking fine.
Worse, if I comment out Clear() and uncomment the DeleteItem() code the leak remains, and the app auto-exits to desktop with nary a complaint after 250 iterations! Most unsettling...
All help much appreciated! Perhaps there's something wrong with my code?
SuperStrict Framework wx.wxApp Import wx.wxFrame Import wx.wxCheckListBox Import wx.wxTimer Import BRL.StandardIO Type MyApp Extends wxApp Field Window:TWindow Method OnInit:Int() Window = TWindow(New TWindow.Create( Null, , "Test CheckListbox leaks" ,,,150,150)) Window.Centre() Window.Show(True) Return True End Method End Type New MyApp.run() Type TWindow Extends wxFrame Field Timer:TTimer Method OnClose(_event:wxCloseEvent) If Timer Timer.Stop() Print "Timer stopped" EndIf _event.Skip() End Method Method OnInit() Timer = New TTimer.CreatewxTimer(Self) Timer.Start(1) Connect(GetId(),wxEVT_CLOSE_WINDOW, _OnClose) End Method Function _OnClose(_event:wxEvent) TWindow(_event.parent).OnClose(wxCloseEvent(_event)) End Function EndType Type TTimer Extends wxTimer Field List:wxCheckListBox Field Window:wxFrame Method CreatewxTimer:TTimer(_window:wxFrame) Window = _window Super.Create() Return Self End Method Method Notify() Global loop_counter:Int = 0 ' Populate the listbox Local s_items:String[] = ["one","two","three","four","five"] List = New wxCheckListBox.Create(Window,wxID_ANY,Null,0,0,100,100) ' Populate list For Local item:Int = 0 Until s_items.length List.Append(s_items[item],"user data_"+item) Next List.Clear() ' This also leaks - but worse - throws us back to desktop with no error after 250 iterations ' For Local item:Int = 0 Until List.GetCount() List.DeleteItem(item) Next Print "iteration " +loop_counter +" " +GCMemAlloced() loop_counter :+ 1 List.Destroy() List = Null End Method End Type