Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NBug] Cannot access a disposed object.Object name: 'FormBrowse'. #11063

Open
Oberon00 opened this issue Jun 20, 2023 · 4 comments
Open

[NBug] Cannot access a disposed object.Object name: 'FormBrowse'. #11063

Oberon00 opened this issue Jun 20, 2023 · 4 comments

Comments

@Oberon00
Copy link

Environment

  • Git Extensions 4.1.0.16698
  • Build 1fe52a1
  • Git 2.41.0.windows.1
  • Microsoft Windows NT 10.0.22621.0
  • .NET 6.0.18
  • DPI 96dpi (no scaling)

Issue description

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'FormBrowse'.
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Form.CreateHandle()
   at System.Windows.Forms.Control.get_Handle()
   at System.Windows.Forms.ContainerControl.FocusActiveControlInternal()
   at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(msoloop reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(msoloop reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at GitUI.GitUICommands.StartBrowseDialog(IWin32Window owner, BrowseArguments args) in C:\projects\gitextensions\GitUI\GitUICommands.cs:line 1163
   at GitUI.GitUICommands.RunBrowseCommand(IReadOnlyList`1 args) in C:\projects\gitextensions\GitUI\GitUICommands.cs:line 1606
   at GitUI.GitUICommands.RunCommandBasedOnArgument(IReadOnlyList`1 args, IReadOnlyDictionary`2 arguments) in C:\projects\gitextensions\GitUI\GitUICommands.cs:line 1460
   at GitUI.GitUICommands.RunCommand(IReadOnlyList`1 args) in C:\projects\gitextensions\GitUI\GitUICommands.cs:line 1433
   at GitExtensions.Program.RunApplication() in C:\projects\gitextensions\GitExtensions\Program.cs:line 204
   at GitExtensions.Program.Main() in C:\projects\gitextensions\GitExtensions\Program.cs:line 105

Closed window right after starting.

Steps to reproduce

Start gitextensions inside a folder with a git repository. Close it right away, while the UI still seems to be loading by middle clicking (press mouse wheel) on the window preview from the Windows taskbar. Seems to be 100% reliably reproducible for me that way.

Note that this does not seem to work by clicking the X button, as there is seems to block that until the UI is fully loaded.

Did this work in previous version of GitExtensions?

I never observed this with earlier versions, but I might also not have run into the case.

Diagnostics

No response

@duplicates-detector-bot
Copy link

Potential duplicates:

  • #6901
  • #8272

@Oberon00
Copy link
Author

Might indeed be the same as #8272 (closed), but here you have steps to reproduce 😃

#6901 looks different at first glance.

@RussKie
Copy link
Member

RussKie commented Jun 21, 2023

Thank you for providing the repro steps. I can't seem able to replicate but I may not be fast enough... For me the preview on the taskbar becomes available after the app has already loaded.
As a workaround - don't try to close it that fast :) A PR with a fix is welcome too.

@Oberon00
Copy link
Author

I had a second instance open before launching the one I closed (that was the reason I closed it actually). Maybe that makes the taskbar hover preview appear sooner. OS is Windows 11.

Yeah "don't try to close it that fast" is a good workaround. 🙂

(The root cause would be solved by a feature request: If starting gitex and the repo is already opened in another instance, focus that instance instead of starting a new one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants