Ds4windows: Error when saving profile

Created on 14 Sep 2019  路  8Comments  路  Source: Ryochan7/DS4Windows

```See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

*** Exception Text ***
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'TrackBar'.
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.GetSafeHandle(IWin32Window window)
at System.Windows.Forms.ToolTip.Hide(IWin32Window win)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

*** Loaded Assemblies ***
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4010.0 built by: NET48REL1LAST_B

CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

DS4Windows
Assembly Version: 1.7.17.0
Win32 Version: 1.7.17

CodeBase: file:///H:/Programs/DS4Windows/DS4Windows.exe

Microsoft.Win32.TaskScheduler
Assembly Version: 2.8.0.0
Win32 Version: 2.8.0.0

CodeBase: file:///H:/Programs/DS4Windows/Microsoft.Win32.TaskScheduler.DLL

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1

CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

Nefarius.ViGEm.Client
Assembly Version: 1.14.3.0
Win32 Version: 1.14.3.0

CodeBase: file:///H:/Programs/DS4Windows/Nefarius.ViGEm.Client.DLL

*** JIT Debugging ***
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:



When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

```

Most helpful comment

Kind of surprise this issue has not come up sooner. Nothing has changed that would directly invoke this problem. Anyway, a simple change seems to have fixed the problem.

All 8 comments

Can you share your profile? It looks like a timer is attempting to get invoked while the Options form is closing. That should not be happening.

I can confirm the bug is present in 1.7.16 and 1.7.17.

I rolled back my installation to 1.7.15 and profile editing and saving is working fine, with the same profile that bugs/crashes on latest versions.

If you create a new default profile, open it for editing and save it (without actually modifying anything) then does it work? Is it so that it crashes only after doing certain changes in a profile or does it crash everytime in Save button?

@Ryochan7 I managed to re-create this problem in the latest github version of DS4Win app. It seems to happen (randomly, not always) when a profile is saved right after lightbar color slider was modified. The key factor here is to press "Save profile" button immediatly after adjusting the color slider. If I wait few seconds after adjusting the color slider before pressing "Save profile" button then it doesn't crash.

This happens with and without controller connected, so the issue is not relating to sending the actual lightbar color to DS4 gamepad.

Looks like the color slider generates few WndProc messages which are received after the profile editor window is already closed/hidden when a save button is pressed "too fast" after adjusting a color slider. Don't know yet why this happens but it is related to trackbar controller.

EDITED: Aaah. Find out why and when this happens. Color slider has a popup tooltip window to show the numerical value of the color slider RGB color value. This tooltip window is shown few seconds after adjusting the color slider and slowly fades away. If "Save profile" or "Cancel" key is pressed while this tooltip text of color slider is still visible then the profile editor crashes because WinOS is trying to hide/fadeaway a tooltip window which is not anymore available. The fix is to make sure that Save and Cancel buttons close all visible tooltip windows before closing the profile window itself or WndProc tooltip messages are ignored in WndProc handler when a form is in "closing" state.

Anyway. Easy "temporary workaround solution" to those users having this issue is to wait few seconds after adjsuting the lightbar color slider.

Kind of surprise this issue has not come up sooner. Nothing has changed that would directly invoke this problem. Anyway, a simple change seems to have fixed the problem.

I can confirm the bug is present in 1.7.17

This bug is fixed in the current devel version. The next official version should have that fix. Meanwhile as a workaround wait few secs after adjusting lightbar color slider (ie. until the popup numerical tooltip text is completely faded out).

Was this page helpful?
0 / 5 - 0 ratings