Commit e7d5b1bf authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Skins2: fix usage of SHFileOperation on Win32

parent 8aaf0872
......@@ -479,7 +479,13 @@ void Win32Factory::changeCursor( CursorType_t type ) const
void Win32Factory::rmDir( const string &rPath )
{
LPWSTR dir = ToWide( rPath.c_str() );
LPWSTR dir_temp = ToWide( rPath.c_str() );
size_t len = wcslen( dir_temp );
LPWSTR dir = (wchar_t *)malloc( (len + 1) * sizeof (wchar_t) );
wcsncpy( dir, dir_temp, len );
dir[len] = '\0';
SHFILEOPSTRUCTW file_op = {
NULL,
FO_DELETE,
......@@ -493,6 +499,9 @@ void Win32Factory::rmDir( const string &rPath )
L"" };
SHFileOperationW(&file_op);
free(dir_temp);
free(dir);
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment