This repository was archived by the owner on Sep 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -630,10 +630,13 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
630630void MCNativeInputFieldControl::DeleteView (UIView *p_view)
631631{
632632 [p_view setDelegate: nil ];
633- [p_view release ];
634633
634+ // MW-2013-05-22: [[ Bug 10880 ]] Make sure we release the delegate here as
635+ // it might need to refer to the view to deregister itself.
635636 [m_delegate release ];
636637 m_delegate = nil ;
638+
639+ [p_view release ];
637640}
638641
639642// //////////////////////////////////////////////////////////////////////////////
@@ -882,10 +885,13 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
882885void MCNativeMultiLineControl::DeleteView (UIView *p_view)
883886{
884887 [p_view setDelegate: nil ];
885- [p_view release ];
886888
889+ // MW-2013-05-22: [[ Bug 10880 ]] Make sure we release the delegate here as
890+ // it might need to refer to the view to deregister itself.
887891 [m_delegate release ];
888892 m_delegate = nil ;
893+
894+ [p_view release ];
889895}
890896
891897// //////////////////////////////////////////////////////////////////////////////
@@ -1133,6 +1139,15 @@ - (id)initWithInstance:(MCNativeInputControl *)instance view:(UIView *)view
11331139 return self;
11341140}
11351141
1142+ // MW-2013-05-22: [[ Bug 10880 ]] Make sure we have a 'dealloc' method so observers
1143+ // can be removed that reference this object.
1144+ - (void )dealloc
1145+ {
1146+ [m_instance -> GetView () removeObserver: self forKeyPath: @" contentSize" ];
1147+ [super dealloc ];
1148+ }
1149+
1150+
11361151- (void )scrollViewWillBeginDragging : (UIScrollView*)scrollView
11371152{
11381153 MCCustomEvent *t_event;
You can’t perform that action at this time.
0 commit comments