fix: Crash when opening file picker
This commit is contained in:
parent
2e630a48f7
commit
4a9bac3cd5
@ -204,7 +204,8 @@ namespace hex::fs {
|
|||||||
|
|
||||||
bool openFileBrowser(DialogMode mode, const std::vector<ItemFilter> &validExtensions, const std::function<void(std::fs::path)> &callback, const std::string &defaultPath, bool multiple) {
|
bool openFileBrowser(DialogMode mode, const std::vector<ItemFilter> &validExtensions, const std::function<void(std::fs::path)> &callback, const std::string &defaultPath, bool multiple) {
|
||||||
// Turn the content of the ItemFilter objects into something NFD understands
|
// Turn the content of the ItemFilter objects into something NFD understands
|
||||||
std::vector<nfdfilteritem_t> validExtensionsNfd(validExtensions.size());
|
std::vector<nfdfilteritem_t> validExtensionsNfd;
|
||||||
|
validExtensionsNfd.reserve(validExtensions.size());
|
||||||
for (const auto &extension : validExtensions) {
|
for (const auto &extension : validExtensions) {
|
||||||
validExtensionsNfd.emplace_back(nfdfilteritem_t{ extension.name.c_str(), extension.spec.c_str() });
|
validExtensionsNfd.emplace_back(nfdfilteritem_t{ extension.name.c_str(), extension.spec.c_str() });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user