Skip to content

Commit 0119663

Browse files
committed
[LINT] error 1579
Pointer member ’Symbol’ (Location) might have been freed by a separate function but no ’-sem(Name,cleanup)’ Signed-off-by: Jocelyn Legault <jocelynlegault@gmail.com>
1 parent 62f590a commit 0119663

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

PythonScript/src/PythonConsole.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
PythonConsole::PythonConsole(HWND hNotepad) :
1717
PyProducerConsumer<std::string>(),
1818
mp_scintillaWrapper(new ScintillaWrapper(NULL)),
19-
mp_python(NULL),
2019
mp_mainThreadState(NULL),
2120
m_hThread(NULL),
2221
m_hNotepad(hNotepad),
@@ -53,7 +52,6 @@ void PythonConsole::initPython(PythonHandler *pythonHandler)
5352
{
5453
try
5554
{
56-
mp_python = pythonHandler;
5755
mp_mainThreadState = pythonHandler->getMainThreadState();
5856

5957
PyGILState_STATE gstate = PyGILState_Ensure();

PythonScript/src/PythonConsole.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class PythonConsole : public NppPythonScript::PyProducerConsumer<std::string>, p
8080
boost::python::object m_console;
8181
boost::python::object m_pushFunc;
8282
boost::python::object m_sys;
83-
PythonHandler* mp_python;
8483
PyThreadState* mp_mainThreadState;
8584
HANDLE m_statementRunning;
8685
HANDLE m_hThread;

PythonScript/src/PythonHandler.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ PythonHandler::PythonHandler(char *pluginsDir, char *configDir, HINSTANCE hInst,
2020
mp_console(pythonConsole),
2121
m_currentView(0),
2222
mp_mainThreadState(NULL),
23-
mp_python(NULL),
2423
m_consumerStarted(false)
2524
{
2625
m_machineBaseDir.append("\\PythonScript\\");
@@ -30,7 +29,6 @@ PythonHandler::PythonHandler(char *pluginsDir, char *configDir, HINSTANCE hInst,
3029
mp_scintilla = createScintillaWrapper();
3130
mp_scintilla1 = new ScintillaWrapper(scintilla1Handle);
3231
mp_scintilla2 = new ScintillaWrapper(scintilla2Handle);
33-
3432
}
3533

3634
PythonHandler::~PythonHandler(void)
@@ -50,7 +48,21 @@ PythonHandler::~PythonHandler(void)
5048

5149
// Can't call finalize with boost::python.
5250
// Py_Finalize();
51+
5352
}
53+
54+
delete mp_scintilla2;
55+
delete mp_scintilla1;
56+
delete mp_scintilla;
57+
delete mp_notepad;
58+
59+
// To please Lint, let's NULL these handles
60+
m_hInst = NULL;
61+
m_nppHandle = NULL;
62+
m_scintilla1Handle = NULL;
63+
m_scintilla2Handle = NULL;
64+
mp_console = NULL;
65+
mp_mainThreadState = NULL;
5466
}
5567
catch (...)
5668
{

PythonScript/src/PythonHandler.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,8 @@ class PythonHandler : public NppPythonScript::PyProducerConsumer<RunScriptArgs>
100100
int m_currentView;
101101

102102
PyThreadState *mp_mainThreadState;
103-
PythonHandler *mp_python;
104103

105104
bool m_consumerStarted;
106-
HANDLE m_hKillWait;
107-
108105
};
109106

110107
#endif

0 commit comments

Comments
 (0)