From f33d8fc1834253b77beb1919984ebe19d98cac99 Mon Sep 17 00:00:00 2001 From: Amun Date: Wed, 27 Aug 2025 14:32:26 +0300 Subject: [PATCH 1/2] More pyvalue pointers --- src/EterPythonLib/PythonGraphicTextModule.cpp | 2 +- src/EterPythonLib/PythonGraphicThingModule.cpp | 4 ++-- src/UserInterface/PythonItemModule.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EterPythonLib/PythonGraphicTextModule.cpp b/src/EterPythonLib/PythonGraphicTextModule.cpp index d6fcd70..49950c7 100644 --- a/src/EterPythonLib/PythonGraphicTextModule.cpp +++ b/src/EterPythonLib/PythonGraphicTextModule.cpp @@ -17,7 +17,7 @@ bool PyTuple_GetTextInstance(PyObject* poArgs, int pos, CGraphicTextInstance** p PyObject* grpTextGenerate(PyObject* poSelf, PyObject* poArgs) { CGraphicTextInstance * pTextInstance = CGraphicTextInstance::New(); - return Py_BuildValue("i", pTextInstance); + return Py_BuildValue("K", pTextInstance); } PyObject* grpTextDestroy(PyObject* poSelf, PyObject* poArgs) diff --git a/src/EterPythonLib/PythonGraphicThingModule.cpp b/src/EterPythonLib/PythonGraphicThingModule.cpp index bb2b9d5..b278fad 100644 --- a/src/EterPythonLib/PythonGraphicThingModule.cpp +++ b/src/EterPythonLib/PythonGraphicThingModule.cpp @@ -20,7 +20,7 @@ PyObject* grpThingGenerate(PyObject* poSelf, PyObject* poArgs) return Py_BuildException(); if (strlen(szFileName) <= 0) - return Py_BuildValue("i", 0); + return Py_BuildValue("K", 0); CResource* pResource = CResourceManager::Instance().GetResourcePointer(szFileName); @@ -32,7 +32,7 @@ PyObject* grpThingGenerate(PyObject* poSelf, PyObject* poArgs) pThingInstance->ReserveModelInstance(1); pThingInstance->RegisterModelThing(0, static_cast(pResource)); pThingInstance->SetModelInstance(0, 0, 0); - return Py_BuildValue("i", pThingInstance); + return Py_BuildValue("K", pThingInstance); } PyObject* grpThingDelete(PyObject* poSelf, PyObject* poArgs) diff --git a/src/UserInterface/PythonItemModule.cpp b/src/UserInterface/PythonItemModule.cpp index 4479be9..2b0706e 100644 --- a/src/UserInterface/PythonItemModule.cpp +++ b/src/UserInterface/PythonItemModule.cpp @@ -282,7 +282,7 @@ PyObject * itemGetIconInstance(PyObject * poSelf, PyObject * poArgs) CGraphicImageInstance * pImageInstance = CGraphicImageInstance::New(); pImageInstance->SetImagePointer(pImage); - return Py_BuildValue("i", pImageInstance); + return Py_BuildValue("K", pImageInstance); } PyObject * itemDeleteIconInstance(PyObject * poSelf, PyObject * poArgs) From d3991c07754cfb18bea7e9b342aabe3dd1976974 Mon Sep 17 00:00:00 2001 From: Amun Date: Wed, 27 Aug 2025 14:34:57 +0300 Subject: [PATCH 2/2] Small mem leak --- src/UserInterface/GuildMarkUploader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UserInterface/GuildMarkUploader.cpp b/src/UserInterface/GuildMarkUploader.cpp index 4089c8f..7f37f98 100644 --- a/src/UserInterface/GuildMarkUploader.cpp +++ b/src/UserInterface/GuildMarkUploader.cpp @@ -223,7 +223,7 @@ void CGuildMarkUploader::__Inialize() if (m_pbySymbolBuf) { - delete m_pbySymbolBuf; + delete[] m_pbySymbolBuf; } m_dwSymbolBufSize = 0;