fixed a crash and a leak in GetShortcutTarget() (closes bug 1541321)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1047,7 +1047,9 @@ bool wxFileName::Normalize(int flags,
|
||||
#include <shlguid.h>
|
||||
#endif
|
||||
|
||||
bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targetFilename, wxString* arguments)
|
||||
bool wxFileName::GetShortcutTarget(const wxString& shortcutPath,
|
||||
wxString& targetFilename,
|
||||
wxString* arguments)
|
||||
{
|
||||
wxString path, file, ext;
|
||||
wxSplitPath(shortcutPath, & path, & file, & ext);
|
||||
@@ -1076,6 +1078,8 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targe
|
||||
MAX_PATH);
|
||||
|
||||
hres = ppf->Load(wsz, 0);
|
||||
ppf->Release();
|
||||
|
||||
if (SUCCEEDED(hres))
|
||||
{
|
||||
wxChar buf[2048];
|
||||
@@ -1096,11 +1100,13 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
psl->Release();
|
||||
}
|
||||
psl->Release();
|
||||
return success;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __WIN32__ && !__WXWINCE__
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user