diff --git a/src/nimqml/private/dotherside.nim b/src/nimqml/private/dotherside.nim index d9721dd..96e9036 100644 --- a/src/nimqml/private/dotherside.nim +++ b/src/nimqml/private/dotherside.nim @@ -204,6 +204,7 @@ proc dos_qobject_objectName(qobject: DosQObject): cstring {.cdecl, dynlib: dynLi proc dos_qobject_setObjectName(qobject: DosQObject, name: cstring) {.cdecl, dynlib: dynLibName, importc.} proc dos_qobject_signal_emit(qobject: DosQObject, signalName: cstring, argumentsCount: cint, arguments: ptr DosQVariantArray) {.cdecl, dynlib: dynLibName, importc.} proc dos_qobject_delete(qobject: DosQObject) {.cdecl, dynlib: dynLibName, importc.} +proc dos_qobject_deleteLater(qobject: DosQObject) {.cdecl, dynlib: dynLibName, importc.} proc dos_qobject_signal_connect(sender: DosQObject, signalName: cstring, receiver: DosQObject, slot: cstring, signalType: cint) {.cdecl, dynlib: dynLibName, importc.} # QAbstractItemModel diff --git a/src/nimqml/private/qobject.nim b/src/nimqml/private/qobject.nim index c076d35..02565d1 100644 --- a/src/nimqml/private/qobject.nim +++ b/src/nimqml/private/qobject.nim @@ -61,7 +61,7 @@ proc delete*(self: QObject) = ## Delete a QObject if not self.owner or self.vptr.isNil: return - dos_qobject_delete(self.vptr) + dos_qobject_deleteLater(self.vptr) self.vptr.resetToNil proc newQObject*(): QObject =