File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,6 +261,13 @@ public virtual void OnRecycle()
261261 m_SerialId = 0 ;
262262 m_DepthInUIGroup = 0 ;
263263 m_PauseCoveredUIForm = true ;
264+ if ( m_EventSubscriber != null )
265+ {
266+ m_EventSubscriber . UnSubscribeAll ( ) ;
267+ ReferencePool . Release ( m_EventSubscriber ) ;
268+ }
269+
270+ m_EventSubscriber = null ;
264271 }
265272
266273 /// <summary>
@@ -291,6 +298,13 @@ public virtual void OnClose(bool isShutdown, object userData)
291298 gameObject . SetLayerRecursively ( m_OriginalLayer ) ;
292299 m_Available = false ;
293300 Visible = false ;
301+ if ( m_EventSubscriber != null )
302+ {
303+ m_EventSubscriber . UnSubscribeAll ( ) ;
304+ ReferencePool . Release ( m_EventSubscriber ) ;
305+ }
306+
307+ m_EventSubscriber = null ;
294308 }
295309
296310 /// <summary>
@@ -362,7 +376,13 @@ public virtual void Dispose()
362376 return ;
363377 }
364378
365- m_EventSubscriber . UnSubscribe ( LocalizationLanguageChangeEventArgs . EventId , OnLocalizationLanguageChanged ) ;
379+ if ( m_EventSubscriber != null )
380+ {
381+ m_EventSubscriber . UnSubscribeAll ( ) ;
382+ ReferencePool . Release ( m_EventSubscriber ) ;
383+ }
384+
385+ m_EventSubscriber = null ;
366386 IsDisposed = true ;
367387 }
368388
You can’t perform that action at this time.
0 commit comments