Skip to content

Commit d69916a

Browse files
DataContext keeps reference to parent BasicIo
1 parent b320f11 commit d69916a

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/interface/basicio.i

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public:
207207
};
208208
};
209209
%}
210+
KEEP_REFERENCE(DataContext*);
210211

211212
// Add Exiv2::BasicIo::data() method to return a context manager
212213
%feature("docstring") Exiv2::BasicIo::data "Return a data context manager.

src/swig-0_27_7/basicio_wrap.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5797,6 +5797,12 @@ SWIGINTERN PyObject *_wrap_BasicIo_data(PyObject *self, PyObject *args) {
57975797
}
57985798
}
57995799
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DataContext, SWIG_POINTER_OWN | 0 );
5800+
5801+
if (resultobj != Py_None)
5802+
if (PyObject_SetAttrString(resultobj, "_refers_to", self)) {
5803+
SWIG_fail;
5804+
}
5805+
58005806
return resultobj;
58015807
fail:
58025808
return NULL;

src/swig-0_28_5/basicio_wrap.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6065,6 +6065,12 @@ SWIGINTERN PyObject *_wrap_BasicIo_data(PyObject *self, PyObject *args) {
60656065
}
60666066
}
60676067
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DataContext, SWIG_POINTER_OWN | 0 );
6068+
6069+
if (resultobj != Py_None)
6070+
if (PyObject_SetAttrString(resultobj, "_refers_to", self)) {
6071+
SWIG_fail;
6072+
}
6073+
60686074
return resultobj;
60696075
fail:
60706076
return NULL;

0 commit comments

Comments
 (0)