1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-30 05:15:59 +02:00

Fix dialogs in release mode

... and inline "GetFilterItems" method so we can use scoped allocation
This commit is contained in:
disarray2077 2021-12-14 16:25:39 -03:00
parent 694e663630
commit 4d337e3a31
3 changed files with 28 additions and 45 deletions

View file

@ -120,14 +120,16 @@ namespace System.IO
Windows.COM_IFileOpenDialog* openDialog = (.)dialog;
if (Multiselect)
{
openDialog.VT.GetResults(openDialog, let results);
Windows.COM_IShellItemArray* results = null;
openDialog.VT.GetResults(openDialog, out results);
if (results != null)
{
results.VT.GetCount(results, let count);
for (uint32 i < count)
{
results.VT.GetItemAt(results, i, let item);
Windows.COM_IShellItem* item = null;
results.VT.GetItemAt(results, i, out item);
if (item != null)
{
let filePath = GetFilePathFromShellItem!(item);
@ -140,7 +142,8 @@ namespace System.IO
}
else
{
openDialog.VT.GetResult(openDialog, let shellItem);
Windows.COM_IShellItem* shellItem = null;
openDialog.VT.GetResult(openDialog, out shellItem);
if (shellItem != null)
{