Closed AndromedaMelody closed 2 years ago
I will keep track of this issue and try my best to reproduce it.
P.S. I can't reproduce this issue on my device at current.
Kenji Mouri
Today, I clicked 'Open Downloads Folder', and then the area of Xaml Islands was turned into black, finally it exited due to exception.
I will keep track of this issue and try my best to reproduce it.
P.S. I can't reproduce this issue on my device at current.
Kenji Mouri
Seems like the download folder is incorrectly set (Japanese?) instead of localized to PC.
I'm using Windows 11 21H2.
On my machine, open downloads folder sometimes jumps to c:\windows\system32 instead of the downloads folder. 19044.1889 here.
It looks not the occasionally cases, I will try to fix them by guessing the possible reasons because I can't reproduce.
I will rewrite some implementations in NanaGet because I met some strange application crashes.
Kenji Mouri
Looks like the std::filesystem::path
returned from NanaGet::GetDownloadsFolderPath
got destructed after c_str().
Seems to work fine now if I store the object to a variable.
diff --git a/NanaGet/MainPage.cpp b/NanaGet/MainPage.cpp
index 8a0a077..bab34cc 100644
--- a/NanaGet/MainPage.cpp
+++ b/NanaGet/MainPage.cpp
@@ -112,11 +112,13 @@ namespace winrt::NanaGet::implementation
{
UNREFERENCED_PARAMETER(sender);
UNREFERENCED_PARAMETER(e);
+
+ std::filesystem::path downloadsFolderPath = NanaGet::GetDownloadsFolderPath();
SHELLEXECUTEINFOW ExecInfo = { 0 };
ExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW);
ExecInfo.lpVerb = L"open";
- ExecInfo.lpFile = NanaGet::GetDownloadsFolderPath().c_str();
+ ExecInfo.lpFile = downloadsFolderPath.c_str();
ExecInfo.nShow = SW_SHOWNORMAL;
::ShellExecuteExW(&ExecInfo);
}
@driver1998
Thank you. I have merged it just now.
Kenji Mouri
APP Version: NanaGet 1.0 (1.0.36.0) System Version: Windows 11 22H1 (22621.1) System Language: English