Skip to content

Commit 0cb4c8a

Browse files
authored
Merge pull request #303 from Hoikas/pygui_ownership
Fix ownership transfer issues in pyGUIControlMod.
2 parents 2ea02bc + 42bf9b3 commit 0cb4c8a

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Python/PRP/GUI/pyGUIControlHandlers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ PyObject* ICreateGUIControlHandler(class pfGUICtrlProcObject*);
4646
PyErr_SetString(PyExc_TypeError, #name " expected type pf" #pyType); \
4747
return -1; \
4848
} \
49+
((py##pyType*)value)->fPyOwned = false; \
4950
self->fThis->setter(((py##pyType*)value)->fThis); \
5051
return 0; \
5152
}

Python/PRP/GUI/pyGUIControlMod.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ PY_GETSET_SETTER_DECL(GUIControlMod, colorScheme)
129129
PyErr_SetString(PyExc_TypeError, "colorScheme should be a pfGUIColorScheme");
130130
return -1;
131131
}
132+
133+
((pyGUIColorScheme*)value)->fPyOwned = false;
132134
self->fThis->setColorScheme(pyPlasma_get<pfGUIColorScheme*>(value));
133135
return 0;
134136
}

0 commit comments

Comments
 (0)