Skip to content

Commit d3cde06

Browse files
committed
[LINT] error 1540:
Warning -- Pointer member 'Symbol' (Location) neither freed nor zero'ed by destructor. 4 such warnings remain in the code for the following variables: - ProcessExecute::m_hStdOutReadPipe - ProcessExecute::m_hStdOutWritePipe - ProcessExecute::m_hStdErrReadPipe - ProcessExecute::m_hStdErrWritePipe Dave is supposed to take care of these in a foreseeable future. Signed-off-by: Jocelyn Legault <jocelynlegault@gmail.com>
1 parent 47f0793 commit d3cde06

6 files changed

Lines changed: 13 additions & 14 deletions

File tree

PythonScript/src/AboutDialog2.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ AboutDialog::AboutDialog(void)
1111

1212
AboutDialog::~AboutDialog(void)
1313
{
14+
if (m_hbrBackground)
15+
{
16+
DeleteObject(m_hbrBackground);
17+
m_hbrBackground = NULL;
18+
}
1419
}
1520

1621
void AboutDialog::doDialog()

PythonScript/src/ConfigFile.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ ConfigFile::ConfigFile(const TCHAR *configDir, const TCHAR *pluginDir, HINSTANCE
3434

3535
ConfigFile::~ConfigFile()
3636
{
37+
m_hInst = NULL;
3738
// TODO: Clean up
3839
// DeleteImage
3940
//

PythonScript/src/PromptDialog.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ PromptDialog::PromptDialog(HINSTANCE hInst, HWND hNotepad)
1515
{
1616
}
1717

18-
1918
PromptDialog::~PromptDialog()
2019
{
20+
m_hInst = NULL;
21+
m_hNotepad = NULL;
22+
// m_hSelf is handed down to us and not created by us. Therefore, let's jsut NULL the variable.
23+
m_hSelf = NULL;
2124
}
2225

23-
24-
2526
PromptDialog::PROMPT_RESULT PromptDialog::prompt(const char *prompt, const char *title, const char *initial)
2627
{
2728
m_result = RESULT_CANCEL;
@@ -34,8 +35,6 @@ PromptDialog::PROMPT_RESULT PromptDialog::prompt(const char *prompt, const char
3435
return m_result;
3536
}
3637

37-
38-
3938
BOOL CALLBACK PromptDialog::dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
4039
{
4140
switch(message)
@@ -58,7 +57,6 @@ BOOL CALLBACK PromptDialog::dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
5857
}
5958
}
6059

61-
6260
BOOL CALLBACK PromptDialog::runDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM /* lParam */)
6361
{
6462
switch(message)

PythonScript/src/PromptDialog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class PromptDialog
3535
std::string m_title;
3636
std::string m_initial;
3737
HWND m_hSelf;
38-
3938
};
4039

4140
#endif

PythonScript/src/ScintillaWrapper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ using namespace boost::python;
1111

1212
ScintillaWrapper::ScintillaWrapper(const HWND handle)
1313
: PyProducerConsumer<CallbackExecArgs*>(),
14-
m_handle(handle),
15-
m_tempString(NULL),
16-
m_tempStringLength(0)
14+
m_handle(handle)
1715
{
1816
}
1917

@@ -30,6 +28,8 @@ void translateOutOfBounds(out_of_bounds_exception const& /* e */)
3028

3129
ScintillaWrapper::~ScintillaWrapper()
3230
{
31+
// m_handle isn't allocated here. Let's just NULL out reference to it, then.
32+
m_handle = NULL;
3333
}
3434
/*
3535
void ScintillaWrapper::addText(str s)

PythonScript/src/ScintillaWrapper.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,10 +2561,6 @@ class ScintillaWrapper : public NppPythonScript::PyProducerConsumer<CallbackExec
25612561
// Active Scintilla handle
25622562
HWND m_handle;
25632563

2564-
// Temporary buffer for returned strings
2565-
int m_tempStringLength;
2566-
char * m_tempString;
2567-
25682564
// Callbacks
25692565

25702566
callbackT m_callbacks;

0 commit comments

Comments
 (0)