mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-27 23:19:13 +08:00
[PreviewHandlers]Check for Disposed state when updating window bounds (#33373)
* Fixed Previewer production crash with an ObjectDisposedException * Bumped MSBuildCacheCacheUniverse
This commit is contained in:
parent
cdf5677eb9
commit
deb6234d72
@ -120,6 +120,12 @@ namespace Common
|
||||
/// </summary>
|
||||
public void UpdateWindowBounds(IntPtr hwnd, Rectangle newBounds)
|
||||
{
|
||||
if (this.Disposing || this.IsDisposed)
|
||||
{
|
||||
// For unclear reasons, this can be called when handling an error and the form has already been disposed.
|
||||
return;
|
||||
}
|
||||
|
||||
// We must set the WS_CHILD style to change the form to a control within the Explorer preview pane
|
||||
int windowStyle = NativeMethods.GetWindowLong(Handle, gwlStyle);
|
||||
if ((windowStyle & wsChild) == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user