summaryrefslogtreecommitdiff
path: root/plugins/BuddyPounce
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-04-14 13:40:54 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-04-14 13:40:54 +0000
commitfbb5d3456c540866ccc249c35b656def0219d8fb (patch)
tree038ed959c17e04650acb26c1e28278c7c49fb687 /plugins/BuddyPounce
parentc0af4589fb0d1cb2a365a5ebe01c1a1ee4bfee7a (diff)
some minor memleaks fixed
git-svn-id: http://svn.miranda-ng.org/main/trunk@12807 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BuddyPounce')
-rw-r--r--plugins/BuddyPounce/src/Version.h22
-rw-r--r--plugins/BuddyPounce/src/dialog.cpp7
-rw-r--r--plugins/BuddyPounce/src/headers.h1
-rw-r--r--plugins/BuddyPounce/src/main.cpp3
4 files changed, 15 insertions, 18 deletions
diff --git a/plugins/BuddyPounce/src/Version.h b/plugins/BuddyPounce/src/Version.h
index 1c5545ba8d..0939edb777 100644
--- a/plugins/BuddyPounce/src/Version.h
+++ b/plugins/BuddyPounce/src/Version.h
@@ -1,14 +1,14 @@
-#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 3
-#define __RELEASE_NUM 2
-#define __BUILD_NUM 1
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 3
+#define __RELEASE_NUM 2
+#define __BUILD_NUM 2
#include <stdver.h>
-#define __PLUGIN_NAME "Buddy pounce"
-#define __FILENAME "BuddyPounce.dll"
-#define __DESCRIPTION "Allows you to send a message to contacts if they change status."
-#define __AUTHOR "Jonathan Gordon"
-#define __AUTHOREMAIL "jdgordy@gmail.com"
-#define __AUTHORWEB "http://miranda-ng.org/p/BuddyPounce/"
-#define __COPYRIGHT "© 2004 Jonathan Gordon"
+#define __PLUGIN_NAME "Buddy pounce"
+#define __FILENAME "BuddyPounce.dll"
+#define __DESCRIPTION "Allows you to send a message to contacts if they change status."
+#define __AUTHOR "Jonathan Gordon"
+#define __AUTHOREMAIL "jdgordy@gmail.com"
+#define __AUTHORWEB "http://miranda-ng.org/p/BuddyPounce/"
+#define __COPYRIGHT "© 2004 Jonathan Gordon"
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp
index e9be19366a..64f3400f94 100644
--- a/plugins/BuddyPounce/src/dialog.cpp
+++ b/plugins/BuddyPounce/src/dialog.cpp
@@ -227,12 +227,9 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LP
{
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)) + 1;
if (length>1) {
- TCHAR *text = (TCHAR*)mir_alloc(length*sizeof(TCHAR));
- if (!text) {
- msg(TranslateT("Couldn't allocate enough memory"), _T(""));
- break;
- }
+ TCHAR *text = (TCHAR*)_alloca(length*sizeof(TCHAR));
GetDlgItemText(hwnd, IDC_MESSAGE, text, length);
+ db_set_ts(hContact, modname, "PounceMsg", text);
}
else db_unset(hContact, modname, "PounceMsg");
}
diff --git a/plugins/BuddyPounce/src/headers.h b/plugins/BuddyPounce/src/headers.h
index 508f3d03f9..c9157088d4 100644
--- a/plugins/BuddyPounce/src/headers.h
+++ b/plugins/BuddyPounce/src/headers.h
@@ -7,6 +7,7 @@
#include <windows.h>
#include <commctrl.h>
#include <time.h>
+#include <malloc.h>
#include <newpluginapi.h>
#include <m_clist.h>
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp
index 03b8e6cb59..f490a77a10 100644
--- a/plugins/BuddyPounce/src/main.cpp
+++ b/plugins/BuddyPounce/src/main.cpp
@@ -145,10 +145,9 @@ int CheckDate(MCONTACT hContact)
void SendPounce(TCHAR *text, MCONTACT hContact)
{
- char* pszUtf = mir_utf8encodeT(text);
+ ptrA pszUtf(mir_utf8encodeT(text));
if (HANDLE hSendId = (HANDLE)CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)pszUtf))
WindowList_Add(hWindowList, (HWND)hSendId, hContact);
-
}
int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam)