handles to NULL before accidentally trying to use them for anything.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6282
cda61777-01e9-0310-a592-
d414129be87e
frontend *fe;
int x, y;
RECT r;
frontend *fe;
int x, y;
RECT r;
WS_CHILD | WS_VISIBLE,
0, 0, 0, 0, /* status bar does these */
NULL, NULL, inst, NULL);
WS_CHILD | WS_VISIBLE,
0, 0, 0, 0, /* status bar does these */
NULL, NULL, inst, NULL);
+ } else
+ fe->statusbar = NULL;
get_max_puzzle_size(fe, &x, &y);
midend_size(fe->me, &x, &y, FALSE);
get_max_puzzle_size(fe, &x, &y);
midend_size(fe->me, &x, &y, FALSE);
SetMenu(fe->hwnd, bar);
}
SetMenu(fe->hwnd, bar);
}
+ fe->bitmap = NULL;
+ new_game_size(fe); /* initialises fe->bitmap */
check_window_size(fe, &x, &y);
check_window_size(fe, &x, &y);
- hdc = GetDC(fe->hwnd);
- fe->bitmap = CreateCompatibleBitmap(hdc, x, y);
- ReleaseDC(fe->hwnd, hdc);
-
SetWindowLong(fe->hwnd, GWL_USERDATA, (LONG)fe);
ShowWindow(fe->hwnd, SW_NORMAL);
SetWindowLong(fe->hwnd, GWL_USERDATA, (LONG)fe);
ShowWindow(fe->hwnd, SW_NORMAL);
SetWindowPos(fe->statusbar, NULL, 0, y, x,
sr.bottom - sr.top, SWP_NOZORDER);
SetWindowPos(fe->statusbar, NULL, 0, y, x,
sr.bottom - sr.top, SWP_NOZORDER);
- DeleteObject(fe->bitmap);
+ if (fe->bitmap) DeleteObject(fe->bitmap);
hdc = GetDC(fe->hwnd);
fe->bitmap = CreateCompatibleBitmap(hdc, x, y);
hdc = GetDC(fe->hwnd);
fe->bitmap = CreateCompatibleBitmap(hdc, x, y);