summaryrefslogtreecommitdiff
path: root/plugins/FileAsMessage/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-04 19:26:46 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-04 19:26:46 +0000
commitfba57c10d9f9552c9c31c20283147348789ef650 (patch)
tree165c4c7ed8fad3c092bf455abf99af4a7a058383 /plugins/FileAsMessage/src
parent73504917190e8d183212ec62ad1668d3e72901a7 (diff)
some code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@7499 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FileAsMessage/src')
-rw-r--r--plugins/FileAsMessage/src/dialog.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp
index 2c2f86ce84..ba9e2ec7c2 100644
--- a/plugins/FileAsMessage/src/dialog.cpp
+++ b/plugins/FileAsMessage/src/dialog.cpp
@@ -447,7 +447,7 @@ void FILEECHO::incomeRequest(char *param)
if(p == NULL) return; *p++ = 0;
CallService(MS_FILE_GETRECEIVEDFILESFOLDER, (WPARAM)hContact, (LPARAM)buf);
strncat(buf, param, sizeof(buf));
- if(filename) free(filename);
+ free(filename);
filename = strdup(buf);
// p == &c
if(*p == 0) return; asBinary = (*p++) != '0';
@@ -1005,6 +1005,7 @@ LRESULT CALLBACK ProgressWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
INT_PTR CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
struct FILEECHO *dat = (struct FILEECHO*)GetWindowLongPtr(hDlg, GWLP_USERDATA);
+ HWND hwndStatus = NULL;
switch( uMsg )
{
case WM_INITDIALOG:
@@ -1014,7 +1015,7 @@ INT_PTR CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
dat->updateTitle();
- CreateStatusWindow(WS_CHILD|WS_VISIBLE, "", hDlg, IDC_STATUS);
+ hwndStatus = CreateStatusWindow(WS_CHILD|WS_VISIBLE, "", hDlg, IDC_STATUS);
SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG)dat);
WindowList_Add(hFileList, hDlg, dat->hContact);
SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcons[ICON_MAIN]);
@@ -1058,8 +1059,7 @@ INT_PTR CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
char *szProto = GetContactProto(dat->hContact);
if (szProto)
{
- int dwStatus;
- dwStatus = db_get_w(dat->hContact,szProto,"Status",ID_STATUS_OFFLINE);
+ int dwStatus = db_get_w(dat->hContact,szProto,"Status",ID_STATUS_OFFLINE);
if(dat->inSend && dwStatus != dat->contactStatus)
{
if(dat->contactStatus == ID_STATUS_OFFLINE)
@@ -1085,6 +1085,7 @@ INT_PTR CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
}
case WM_DESTROY:
WindowList_Remove(hFileList, hDlg);
+ DestroyWindow(hwndStatus);
delete dat;
return TRUE;
@@ -1103,7 +1104,7 @@ INT_PTR CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
if(dat->iState & (STATE_IDLE|STATE_FINISHED|STATE_CANCELLED|STATE_PRERECV))
{
int len = GetWindowTextLength(GetDlgItem(hDlg, IDC_FILENAME))+1;
- if(dat->filename) free(dat->filename);
+ free(dat->filename);
dat->filename = (char*)malloc(len);
GetDlgItemText(hDlg, IDC_FILENAME, dat->filename, len);
if(dat->inSend)