mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[loc] fix a crash on exit
* Don't free loc_filename if it points to embedded name * Also fix resizing of main dialog
This commit is contained in:
parent
ff28e2027c
commit
4e840a6995
3 changed files with 12 additions and 9 deletions
|
@ -131,6 +131,7 @@ void init_localization(void) {
|
||||||
void exit_localization(void) {
|
void exit_localization(void) {
|
||||||
free_dialog_list();
|
free_dialog_list();
|
||||||
free_locale_list();
|
free_locale_list();
|
||||||
|
if (loc_filename != embedded_loc_filename)
|
||||||
safe_free(loc_filename);
|
safe_free(loc_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,6 +241,8 @@ void apply_localization(int dlg_id, HWND hDlg)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
hCtrl = hDlg;
|
hCtrl = hDlg;
|
||||||
|
if (dlg_id == IDD_DIALOG)
|
||||||
|
hDlg = NULL;
|
||||||
} else {
|
} else {
|
||||||
hCtrl = GetDlgItem(hDlg, lcmd->ctrl_id);
|
hCtrl = GetDlgItem(hDlg, lcmd->ctrl_id);
|
||||||
}
|
}
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 206, 329
|
IDD_DIALOG DIALOGEX 12, 12, 206, 329
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_APPWINDOW
|
EXSTYLE WS_EX_APPWINDOW
|
||||||
CAPTION "Rufus v1.4.0.284"
|
CAPTION "Rufus v1.4.0.285"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
|
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
|
||||||
|
@ -284,8 +284,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,4,0,284
|
FILEVERSION 1,4,0,285
|
||||||
PRODUCTVERSION 1,4,0,284
|
PRODUCTVERSION 1,4,0,285
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -302,13 +302,13 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "1.4.0.284"
|
VALUE "FileVersion", "1.4.0.285"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus.exe"
|
VALUE "OriginalFilename", "rufus.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "1.4.0.284"
|
VALUE "ProductVersion", "1.4.0.285"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
|
@ -466,12 +466,12 @@ void ResizeMoveCtrl(HWND hDlg, HWND hCtrl, int dx, int dy, int dw, int dh)
|
||||||
GetWindowRect(hCtrl, &rect);
|
GetWindowRect(hCtrl, &rect);
|
||||||
point.x = rect.left;
|
point.x = rect.left;
|
||||||
point.y = rect.top;
|
point.y = rect.top;
|
||||||
ScreenToClient((hDlg==hMainDialog)?hDlg:NULL, &point);
|
ScreenToClient(hDlg, &point);
|
||||||
GetClientRect(hCtrl, &rect);
|
GetClientRect(hCtrl, &rect);
|
||||||
|
|
||||||
// If we're dealing with a dialog, we must take the border into account
|
// If we're dealing with a dialog, we must take the border into account
|
||||||
if (hCtrl == hDlg)
|
if ((hCtrl == hDlg) || (hDlg == NULL))
|
||||||
border = GetBorderSize(hDlg);
|
border = GetBorderSize(hCtrl);
|
||||||
MoveWindow(hCtrl, point.x + (int)(fScale*(float)dx), point.y + (int)(fScale*(float)dy),
|
MoveWindow(hCtrl, point.x + (int)(fScale*(float)dx), point.y + (int)(fScale*(float)dy),
|
||||||
(rect.right - rect.left) + (int)(fScale*(float)dw + border.cx),
|
(rect.right - rect.left) + (int)(fScale*(float)dw + border.cx),
|
||||||
(rect.bottom - rect.top) + border.cy, TRUE);
|
(rect.bottom - rect.top) + border.cy, TRUE);
|
||||||
|
|
Loading…
Reference in a new issue