mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00
GFilePicker: Fix crash in get_save_filepath()
Oops, don't create GFilePickers on the stack! Spotted by Sergey ^)
This commit is contained in:
parent
3bee9d3d3c
commit
03725c6135
1 changed files with 3 additions and 3 deletions
|
@ -30,10 +30,10 @@ Optional<String> GFilePicker::get_open_filepath()
|
|||
|
||||
Optional<String> GFilePicker::get_save_filepath(const String& title, const String& extension)
|
||||
{
|
||||
GFilePicker picker(Mode::Save, String::format("%s.%s", title.characters(), extension.characters()));
|
||||
auto picker = GFilePicker::construct(Mode::Save, String::format("%s.%s", title.characters(), extension.characters()));
|
||||
|
||||
if (picker.exec() == GDialog::ExecOK) {
|
||||
String file_path = picker.selected_file().string();
|
||||
if (picker->exec() == GDialog::ExecOK) {
|
||||
String file_path = picker->selected_file().string();
|
||||
|
||||
if (file_path.is_null())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue