mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 20:31:56 +00:00
More clean up in dealloc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13633 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b311bf3e81
commit
c0d3cf0bdb
1 changed files with 16 additions and 10 deletions
|
@ -302,19 +302,25 @@ static NSNotificationCenter *nc;
|
||||||
{
|
{
|
||||||
if (_tvf.owns_text_network == YES)
|
if (_tvf.owns_text_network == YES)
|
||||||
{
|
{
|
||||||
/* Prevent recursive dealloc */
|
if (_textStorage != nil)
|
||||||
if (_tvf.is_in_dealloc == YES)
|
|
||||||
{
|
{
|
||||||
|
/* Balance the RELEASE we sent to us to break the retain cycle
|
||||||
|
in initWithFrame: or initWithCoder: (otherwise releasing the
|
||||||
|
_textStorage will make our retain count go below zero ;-) */
|
||||||
|
RETAIN (self);
|
||||||
|
|
||||||
|
/* This releases all the text objects (us included) in
|
||||||
|
* fall. */
|
||||||
|
DESTROY (_textStorage);
|
||||||
|
|
||||||
|
/* When the rest of the text network is released, we'll be
|
||||||
|
* released again and be deallocated for real. That will
|
||||||
|
* likely happen during the DESTROY of the _textStorage, or
|
||||||
|
* later if parts of the text network are maybe retained
|
||||||
|
* elsewhere (in autorelease pools etc) for slightly longer.
|
||||||
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_tvf.is_in_dealloc = YES;
|
|
||||||
/* Balance the RELEASE we sent to us to break the retain cycle
|
|
||||||
in initWithFrame: or initWithCoder: (otherwise releasing the
|
|
||||||
_textStorage will make our retain count go below zero ;-) */
|
|
||||||
RETAIN (self);
|
|
||||||
|
|
||||||
/* This releases all the text objects (us included) in fall */
|
|
||||||
RELEASE (_textStorage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_insertionPointTimer != nil)
|
if (_insertionPointTimer != nil)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue