0

recently I decided to implement the WeifenLuo DockPanel Suite into my VB.NET application. Everything works fine, until you try and close the application, where it then freezes. Nothing happens.

I tried:

  • Disposing of the DockPanel before closing
  • Using Application.Exit()
  • RunningApplication.DoEvents() before closing
  • Closing any open DockPanel forms before closing.
  • Running the application outside of the Visual Studio Debugger.
  • Setting Visual Studio to target x86 instead of AnyCPU
  • Upgrading/Downloading the DockPanel Suite framework version

Yet still nothing,t still simply freezes.

The output shows the following messages:

The thread 0x1f34 has exited with code 259 (0x103).
The thread 0x22b8 has exited with code 259 (0x103).

With the thread names being different each time. However I don't have any threads running.

This only occurs on the form with the DockPanel.

Any thoughts? I can't find anyone else with this issue online, and it is really frustrating.

Thanks.

TheRyan722
  • 1,029
  • 13
  • 37
  • So it is reproduable on a bare minimum example? Like, create new project, reference DPS, add a dockpanel to form1 and run the project. Does it crash? If not, what are you doing with the Dockpanel? What code does your shutdown procedure include? I'm using DPS and it works fine, so you are doing something that makes it not work and we can't know what it is if you don't tell us what you do in the first place :-) – Jens Apr 24 '15 at 21:17

1 Answers1

0

In the form closing event of my application, I iterated through any open documents in the DockPanel using:

While i < DockPanel1.ActiveDocumentPane.Contents.Count
        Dim dockContent As IDockContent = DockPanel1.ActiveDocumentPane.Contents(i)
        dockContent.DockHandler.Close()
End While

This is what was causing the application to freeze. To fix this, I replaced the code with this:

For Each item As DockContent In DockPanel1.Documents
        item.DockHandler.Close()
Next
TheRyan722
  • 1,029
  • 13
  • 37