X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..b5a7b0005781f24ab97ed3322530423b6d89fb67:/src/msw/dcprint.cpp diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 05daa7826d..35c9be54be 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -247,12 +247,13 @@ static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName) lpszDriverName = (LPSTR)lpDevNames + lpDevNames->wDriverOffset; lpszDeviceName = (LPSTR)lpDevNames + lpDevNames->wDeviceOffset; lpszPortName = (LPSTR)lpDevNames + lpDevNames->wOutputOffset; - GlobalUnlock(pd.hDevNames); - GlobalFree(pd.hDevNames); - pd.hDevNames=NULL; deviceName = lpszDeviceName; portName = lpszPortName; + + GlobalUnlock(pd.hDevNames); + GlobalFree(pd.hDevNames); + pd.hDevNames=NULL; } if (pd.hDevMode)