Fix for toolbar potentially using a NULL pointer.
This commit is contained in:
parent
5797fbb87e
commit
a1aeeb2b05
|
@ -205,6 +205,9 @@ TOOLBAR_CheckStyle (HWND hwnd, DWORD dwStyle)
|
||||||
static INT
|
static INT
|
||||||
TOOLBAR_SendNotify (NMHDR *nmhdr, TOOLBAR_INFO *infoPtr, UINT code)
|
TOOLBAR_SendNotify (NMHDR *nmhdr, TOOLBAR_INFO *infoPtr, UINT code)
|
||||||
{
|
{
|
||||||
|
if(!IsWindow(infoPtr->hwndSelf))
|
||||||
|
return 0; /* we have just been destroyed */
|
||||||
|
|
||||||
nmhdr->idFrom = GetDlgCtrlID (infoPtr->hwndSelf);
|
nmhdr->idFrom = GetDlgCtrlID (infoPtr->hwndSelf);
|
||||||
nmhdr->hwndFrom = infoPtr->hwndSelf;
|
nmhdr->hwndFrom = infoPtr->hwndSelf;
|
||||||
nmhdr->code = code;
|
nmhdr->code = code;
|
||||||
|
@ -1415,7 +1418,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
PCUSTDLG_INFO custInfo = (PCUSTDLG_INFO)GetWindowLongA (hwnd, DWL_USER);
|
PCUSTDLG_INFO custInfo = (PCUSTDLG_INFO)GetWindowLongA (hwnd, DWL_USER);
|
||||||
PCUSTOMBUTTON btnInfo;
|
PCUSTOMBUTTON btnInfo;
|
||||||
NMTOOLBARA nmtb;
|
NMTOOLBARA nmtb;
|
||||||
TOOLBAR_INFO *infoPtr = custInfo->tbInfo;
|
TOOLBAR_INFO *infoPtr = custInfo ? custInfo->tbInfo : NULL;
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
|
@ -1429,6 +1432,8 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
|
infoPtr = custInfo->tbInfo;
|
||||||
|
|
||||||
/* send TBN_QUERYINSERT notification */
|
/* send TBN_QUERYINSERT notification */
|
||||||
nmtb.iItem = custInfo->tbInfo->nNumButtons;
|
nmtb.iItem = custInfo->tbInfo->nNumButtons;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue