Orc.Controls icon indicating copy to clipboard operation
Orc.Controls copied to clipboard

Added NULL check before unsubscribing from PasswordChanged (PasswordBindBehaviour)

Open Mazzelfassel opened this issue 2 years ago • 2 comments

Description of Change

When working with the ConnectionStringBuilder I got a crash every time I closed the window. After some investigation I figured out, that the Problem is the PasswordBindBehaviour. When the window is closed the password-box is removed and the AssociatedObject property is set to null before the OnAssociatedObjectUnloaded method gets called. This results in an exception being thrown.

To prevent this I added a NULL check before the unsubscription is done. There should be no problems with memory leaks or lingering connectios even when not explicitly unsubscribing.

API Changes

None

Platforms Affected

  • All

Behavioral Changes

None

Testing Procedure

PR Checklist

  • [ ] I have included examples or tests
  • [ ] I have updated the change log
  • [ ] I am listed in the CONTRIBUTORS file
  • [ ] Rebased on top of the target branch at time of PR
  • [ ] Changes adhere to coding standard

Mazzelfassel avatar Mar 17 '23 13:03 Mazzelfassel

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 17 '23 13:03 CLAassistant

@Mazzelfassel, thanks for reporting and suggesting a fix. Will try to reproduce and check your fixes.

ceo1647 avatar Mar 30 '23 11:03 ceo1647