From 68e1a320096ba5530563cec239bc6c476253dc2a Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Sun, 5 Jun 2016 18:04:00 +0300 Subject: [PATCH] Crash when EVE client is closed while the thumbnail is recreated or updated --- Eve-O-Preview/UI/Implementation/ThumbnailView.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Eve-O-Preview/UI/Implementation/ThumbnailView.cs b/Eve-O-Preview/UI/Implementation/ThumbnailView.cs index 3d58bc7..e71a7cb 100644 --- a/Eve-O-Preview/UI/Implementation/ThumbnailView.cs +++ b/Eve-O-Preview/UI/Implementation/ThumbnailView.cs @@ -153,7 +153,14 @@ namespace EveOPreview.UI this._currentHeight = this.ClientRectangle.Bottom; this._Thumbnail.rcDestination = new RECT(0, 0, this._currentWidth, this._currentHeight); - DwmApiNativeMethods.DwmUpdateThumbnailProperties(this._ThumbnailHandle, this._Thumbnail); + try + { + DwmApiNativeMethods.DwmUpdateThumbnailProperties(this._ThumbnailHandle, this._Thumbnail); + } + catch (ArgumentException) + { + //This exception will be thrown if the EVE client disappears while this method is running + } } if (!(this.IsOverlayEnabled && (sizeChanged || locationChanged)))