diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 45ac9c3c09..b8bcd62b3d 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -1455,10 +1455,14 @@ bool wxGridCellCoords_helper(PyObject* source, wxGridCellCoords** obj) { // Typemap to convert an array of cells coords to a list of tuples... -%typemap(python, out) wxGridCellCoordsArray& { +%typemap(python, out) wxGridCellCoordsArray { $target = wxGridCellCoordsArray_helper($source); } +%typemap(python, ret) wxGridCellCoordsArray { + delete $source; +} + // ...and the helper function for the above typemap. %{ @@ -1801,9 +1805,9 @@ public: bool IsInSelection( int row, int col ); // TODO: ??? bool IsInSelection( const wxGridCellCoords& coords ) - const wxGridCellCoordsArray& GetSelectedCells() const; - const wxGridCellCoordsArray& GetSelectionBlockTopLeft() const; - const wxGridCellCoordsArray& GetSelectionBlockBottomRight() const; + const wxGridCellCoordsArray GetSelectedCells() const; + const wxGridCellCoordsArray GetSelectionBlockTopLeft() const; + const wxGridCellCoordsArray GetSelectionBlockBottomRight() const; const wxArrayInt GetSelectedRows() const; const wxArrayInt GetSelectedCols() const; diff --git a/wxPython/src/msw/grid.cpp b/wxPython/src/msw/grid.cpp index 9a3d6a3252..7d014abd12 100644 --- a/wxPython/src/msw/grid.cpp +++ b/wxPython/src/msw/grid.cpp @@ -12581,13 +12581,15 @@ static PyObject *_wrap_wxGrid_GetSelectedCells(PyObject *self, PyObject *args, P } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - const wxGridCellCoordsArray & _result_ref = wxGrid_GetSelectedCells(_arg0); - _result = (wxGridCellCoordsArray *) &_result_ref; + _result = new wxGridCellCoordsArray (wxGrid_GetSelectedCells(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ _resultobj = wxGridCellCoordsArray_helper(_result); +} +{ + delete _result; } return _resultobj; } @@ -12612,13 +12614,15 @@ static PyObject *_wrap_wxGrid_GetSelectionBlockTopLeft(PyObject *self, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - const wxGridCellCoordsArray & _result_ref = wxGrid_GetSelectionBlockTopLeft(_arg0); - _result = (wxGridCellCoordsArray *) &_result_ref; + _result = new wxGridCellCoordsArray (wxGrid_GetSelectionBlockTopLeft(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ _resultobj = wxGridCellCoordsArray_helper(_result); +} +{ + delete _result; } return _resultobj; } @@ -12643,13 +12647,15 @@ static PyObject *_wrap_wxGrid_GetSelectionBlockBottomRight(PyObject *self, PyObj } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - const wxGridCellCoordsArray & _result_ref = wxGrid_GetSelectionBlockBottomRight(_arg0); - _result = (wxGridCellCoordsArray *) &_result_ref; + _result = new wxGridCellCoordsArray (wxGrid_GetSelectionBlockBottomRight(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ _resultobj = wxGridCellCoordsArray_helper(_result); +} +{ + delete _result; } return _resultobj; }