files-community / Files

A modern file manager that helps users organize their files and folders.
https://files.community
MIT License
34.48k stars 2.2k forks source link

Bug: Removing tab in full screen mode crashes app #14417

Open phougt opened 10 months ago

phougt commented 10 months ago

Description

Greeting everyone, Files crash whenever I close tab after creating it in fullscreen mode. If I create a new tab in non-fullscreen mode, then delete it fullscreen mode, it doesn't crash.

Steps To Reproduce

  1. Open Files in fullscreen mode (F11)
  2. Add new tab.
  3. Close the newly created tab

Requirements

I expected it to not crash after closing tab.

Files Version

3.1.1.0

Windows Version

10.0.22635.2921

Log File

debug.log

hishitetsu commented 10 months ago

I can reproduce this issue as well. But oddly enough, it doesn't reproduce when I enable debugging in Visual Studio.

yaira2 commented 10 months ago

Thank you for the report

el-ev commented 9 months ago

It appears to be caused by PR #14342 .

el-ev commented 4 months ago

This issue seems to no longer occur in version 3.5.0.0. But keep creating and closing new tabs in full-screen mode (create ~10 tabs, close them all, repeat) can sometimes cause crashes.

2024-07-06 14:44:55.2307|Error|System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidCastException: Specified cast is not valid.
   at WinRT.IObjectReference.As[T](Guid iid)
   at Microsoft.UI.Input.InputNonClientPointerSource..ctor(IObjectReference objRef)
   at InvokeStub_InputNonClientPointerSource..ctor(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at WinRT.DefaultComWrappers.CreateObject(IntPtr externalComObject)
   at System.Runtime.InteropServices.ComWrappers.CallCreateObject(ComWrappersScenario scenario, ComWrappers comWrappersImpl, IntPtr externalComObject, CreateObjectFlags flags)
   at System.Runtime.InteropServices.ComWrappers.<TryGetOrCreateObjectForComInstanceInternal>g____PInvoke|18_0(ObjectHandleOnStack __comWrappersImpl_native, Int64 __wrapperId_native, IntPtr __externalComObject_native, IntPtr __innerMaybe_native, CreateObjectFlags __flags_native, ObjectHandleOnStack __wrapper_native, ObjectHandleOnStack __retValue_native)
   at WinRT.ComWrappersSupport.CreateRcwForComObject[T](IntPtr ptr, Boolean tryUseCache)
   at WinRT.MarshalInspectable`1.FromAbi(IntPtr ptr)
   at ABI.Microsoft.UI.Input.IInputNonClientPointerSourceStaticsMethods.GetForWindowId(IObjectReference _obj, WindowId windowId)
   at Files.App.Helpers.DragZoneHelper.RaiseSetTitleBarDragRegion(Window window, SetTitleBarDragRegionDelegate setTitleBarDragRegion)
   at ABI.Microsoft.UI.Xaml.SizeChangedEventHandler.Do_Abi_Invoke(IntPtr thisPtr, IntPtr sender, IntPtr e)
yaira2 commented 2 months ago

I can still repro this in v3.6