]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed resource leak for wxListItem
authorRobin Dunn <robin@alldunn.com>
Sat, 28 Jul 2001 03:10:39 +0000 (03:10 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 28 Jul 2001 03:10:39 +0000 (03:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/controls2.i
wxPython/src/msw/controls2.py

index 77ae496ebc024746ced256fe949293df8731eb8d..42a787dbe0f35c946af11f5d3c0b10397a4df728 100644 (file)
@@ -299,6 +299,15 @@ public:
             self->GetItem(*info);
             return info;
         }
+    }  // The OOR typemaps don't know what to do with the %new, so fix it up.
+    %pragma(python) addtoclass = "
+    def GetItem(self, *_args, **_kwargs):
+        val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs)
+        val.thisown = 1
+        return val
+    "
+
+    %addmethods {
         %new wxPoint* GetItemPosition(long item) {
             wxPoint* pos = new wxPoint;
             self->GetItemPosition(item, *pos);
index c7490103de5304a92b57847027a821e741584160..46c97a51f12b91e440ed5b6bf701e2d05ba73309 100644 (file)
@@ -480,6 +480,12 @@ class wxListCtrlPtr(wxControlPtr):
         return val
     def __repr__(self):
         return "<C wxListCtrl instance at %s>" % (self.this,)
+    
+    def GetItem(self, *_args, **_kwargs):
+        val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs)
+        val.thisown = 1
+        return val
+    
 class wxListCtrl(wxListCtrlPtr):
     def __init__(self,*_args,**_kwargs):
         self.this = apply(controls2c.new_wxListCtrl,_args,_kwargs)