diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-01-21 20:47:21 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-01-21 20:47:21 +0000 |
commit | 43a1216dcb4a4e381a0c917f8eb9db89119073d7 (patch) | |
tree | bd57618f48a43702fd6b1eccaf390ea4767895eb /plugins/HistoryStats/src/statistic.cpp | |
parent | c5d77bbf98e23fec98db55c9708525eafd447b0b (diff) |
HistoryStats:
-Fixed memory leak
-minor cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@11890 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HistoryStats/src/statistic.cpp')
-rw-r--r-- | plugins/HistoryStats/src/statistic.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp index 3a202f3f09..61647087cd 100644 --- a/plugins/HistoryStats/src/statistic.cpp +++ b/plugins/HistoryStats/src/statistic.cpp @@ -1477,15 +1477,16 @@ void Statistic::run(const Settings& settings, InvocationSource invokedFrom, HINS m_bRunning = true;
- // create object holding and performing the statistics
- Statistic* pStats = new Statistic(settings, invokedFrom, hInst);
-
+ HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
// create event for thread stack unwinding
- if ((pStats->m_hThreadPushEvent = CreateEvent(NULL, FALSE, FALSE, NULL)) == NULL) {
+ if (hEvent == NULL) {
m_bRunning = false;
return;
}
+ // create object holding and performing the statistics
+ Statistic *pStats = new Statistic(settings, invokedFrom, hInst);
+ pStats->m_hThreadPushEvent = hEvent;
// create worker thread
DWORD dwThreadID = 0;
HANDLE hThread = CreateThread(NULL, 0, threadProc, pStats, 0, &dwThreadID);
|