From 34ceeddecb9bec0eed260e5abf0d59ad2dce7d29 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Mon, 12 Nov 2012 17:50:08 +0200 Subject: [PATCH] Fixed mistake in 463c3a0 --- SkinInstaller/DialogPackage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SkinInstaller/DialogPackage.cpp b/SkinInstaller/DialogPackage.cpp index 421d8f5e..e40d8ea4 100644 --- a/SkinInstaller/DialogPackage.cpp +++ b/SkinInstaller/DialogPackage.cpp @@ -746,8 +746,10 @@ INT_PTR CALLBACK CDialogPackage::SelectPluginDlgProc(HWND hWnd, UINT uMsg, WPARA LOADED_IMAGE* loadedImage = ImageLoad(ConvertToAscii(buffer).c_str(), NULL); if (loadedImage) { - if ((x32 && loadedImage->FileHeader->FileHeader.Machine == IMAGE_FILE_MACHINE_I386) || - (!x32 && loadedImage->FileHeader->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64)) + WORD machine = loadedImage->FileHeader->FileHeader.Machine; + ImageUnload(loadedImage); + + if ((x32 && machine == IMAGE_FILE_MACHINE_I386) || (!x32 && machine == IMAGE_FILE_MACHINE_AMD64)) { // Check if same name as other DLL auto plugins = (std::pair*)GetWindowLongPtr(hWnd, GWLP_USERDATA); @@ -769,8 +771,6 @@ INT_PTR CALLBACK CDialogPackage::SelectPluginDlgProc(HWND hWnd, UINT uMsg, WPARA } break; } - - ImageUnload(loadedImage); } MessageBox(hWnd, L"Invalid plugin.", L"Rainmeter Skin Packager", MB_OK | MB_TOPMOST);