Fixing stack allocation bug in file picker.

This commit is contained in:
Ben Vanik 2015-06-30 16:03:05 -07:00
parent 60290fe526
commit 90e86d0172
1 changed files with 2 additions and 1 deletions

View File

@ -149,7 +149,8 @@ bool Win32FilePicker::Show(void* parent_window_handle) {
// Set the file types to display only. Notice that this is a 1-based array.
std::vector<COMDLG_FILTERSPEC> save_types;
for (auto& extension : extensions()) {
auto extensions = this->extensions();
for (auto& extension : extensions) {
save_types.push_back({extension.first.c_str(), extension.second.c_str()});
}
hr = file_dialog->SetFileTypes(static_cast<UINT>(save_types.size()),