Skip to content

Commit

Permalink
Merge pull request #8728 from Agsayt/Issue/6334
Browse files Browse the repository at this point in the history
fix: Fixed AccessViolationException that occurs in GLibSharp.dll after storage picker interaction
  • Loading branch information
mergify[bot] authored May 10, 2022
2 parents cd24160 + 2bd123f commit 6d7f534
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private async Task<StorageFile[]> OpenPickerAsync(bool multiple)
commitText = _picker.CommitButtonText;
}

FileChooserDialog dialog = new FileChooserDialog(
using FileChooserDialog dialog = new FileChooserDialog(
"Open",
GtkHost.Window,
FileChooserAction.Open,
Expand Down Expand Up @@ -77,7 +77,6 @@ private async Task<StorageFile[]> OpenPickerAsync(bool multiple)
}
}

dialog.Destroy();
return files.ToArray();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public FileSavePickerExtension(FileSavePicker owner)
commitText = _picker.CommitButtonText;
}

FileChooserDialog dialog = new FileChooserDialog(
using FileChooserDialog dialog = new FileChooserDialog(
"Save File",
GtkHost.Window,
FileChooserAction.Save,
Expand All @@ -49,7 +49,7 @@ public FileSavePickerExtension(FileSavePicker owner)
file = await StorageFile.GetFileFromPathAsync(dialog.Filename);
}

dialog.Destroy();

return file;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public FolderPickerExtension(FolderPicker owner)
commitText = _picker.CommitButtonText;
}

FileChooserDialog dialog = new FileChooserDialog(
using FileChooserDialog dialog = new FileChooserDialog(
"Select Folder",
GtkHost.Window,
FileChooserAction.SelectFolder,
Expand All @@ -49,7 +49,6 @@ public FolderPickerExtension(FolderPicker owner)
folder = await StorageFolder.GetFolderFromPathAsync(dialog.Filename);
}

dialog.Destroy();
return folder;
}
}
Expand Down

0 comments on commit 6d7f534

Please sign in to comment.