diff --git a/SunnyUI/Controls/UIGifAvatar.cs b/SunnyUI/Controls/UIGifAvatar.cs index 29c9cbff..35ca1290 100644 --- a/SunnyUI/Controls/UIGifAvatar.cs +++ b/SunnyUI/Controls/UIGifAvatar.cs @@ -20,6 +20,7 @@ ******************************************************************************/ using System; +using System.Collections.Concurrent; using System.ComponentModel; using System.Drawing; using System.Drawing.Imaging; @@ -131,6 +132,8 @@ namespace Sunny.UI } } + private ConcurrentDictionary Images = new ConcurrentDictionary(); + private int avatarSize = 120; [DefaultValue(120), Description("头像大小"), Category("SunnyUI")] diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index 675a1ac0..fa64285e 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -37,6 +37,7 @@ * 2022-06-11: V3.1.9 弹窗默认关闭半透明遮罩 * 2022-07-05: V3.2.1 多页面框架增加PageAdded,PageSelected,PageRemoved事件 * 2022-07-14: V3.2.1 增加UnRegisterHotKey,卸载全局热键 + * 2022-07-25: V3.2.2 多页面框架增加程序关闭时调用UIPage的Final和FormClosed事件 ******************************************************************************/ using System; @@ -1625,6 +1626,21 @@ namespace Sunny.UI } } + protected override void OnFormClosed(FormClosedEventArgs e) + { + base.OnFormClosed(e); + + if (MainTabControl != null) + { + foreach (var item in MainTabControl.GetControls(true)) + { + item.Final(); + item.Close(); + item.Dispose(); + } + } + } + [Description("文字对齐方式"), Category("SunnyUI")] public StringAlignment TextAlignment {