Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private static void PropertiesWindow_Closed(object sender, WindowEventArgs args)
{
if (!App.AppModel.IsMainWindowClosed && sender is WindowEx window)
{
args.Handled = true;
args.Handled = false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Setting args.Handled = false in PropertiesWindow_Closed() allows window destruction, reintroducing known access violations.
Severity: CRITICAL | Confidence: 1.00

🔍 Detailed Analysis

The PropertiesWindow_Closed() event handler is modified to set args.Handled = false. This change allows the properties window object to be destroyed upon closure. This directly reverts a previous workaround implemented to prevent access violations, which were observed when the window was destroyed, particularly for inactive or background windows. The original workaround involved setting args.Handled = true to prevent destruction and instead cache the window, addressing issue #12057.

💡 Suggested Fix

Revert args.Handled = false to args.Handled = true in the PropertiesWindow_Closed() event handler to prevent window destruction and maintain the existing workaround for issue #12057.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/Files.App/Utils/Storage/Helpers/FilePropertiesHelpers.cs#L156

Potential issue: The `PropertiesWindow_Closed()` event handler is modified to set
`args.Handled = false`. This change allows the properties window object to be destroyed
upon closure. This directly reverts a previous workaround implemented to prevent access
violations, which were observed when the window was destroyed, particularly for inactive
or background windows. The original workaround involved setting `args.Handled = true` to
prevent destruction and instead cache the window, addressing issue #12057.

Did we get this right? 👍 / 👎 to inform future reviews.


window.AppWindow.Hide();
window.Content = null;
Expand Down