]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dcprint.cpp
Initial revision
[wxWidgets.git] / src / msw / dcprint.cpp
index 05daa7826dca9467b5b681952548fd3725c3bbd4..35c9be54be32ce76eb13192b1646ca4b576b6857 100644 (file)
@@ -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)