mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +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)
|
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) {
|
if (picker->exec() == GDialog::ExecOK) {
|
||||||
String file_path = picker.selected_file().string();
|
String file_path = picker->selected_file().string();
|
||||||
|
|
||||||
if (file_path.is_null())
|
if (file_path.is_null())
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue