mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix for possible crash after instance deallocated
This commit is contained in:
parent
fe863c981d
commit
e3b7fa5720
2 changed files with 27 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2023-06-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSFileHandle.m: Fix to reliably remove handle from run loop
|
||||
when -dealloc is called without the handle having been closed first.
|
||||
|
||||
2023-05-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tools/AGSParser.m: Add support for OSX version numbers up to 15
|
||||
|
|
|
@ -370,12 +370,30 @@ static GSTcpTune *tune = nil;
|
|||
DESTROY(address);
|
||||
DESTROY(service);
|
||||
DESTROY(protocol);
|
||||
DESTROY(readInfo);
|
||||
DESTROY(writeInfo);
|
||||
|
||||
/* Finalize *after* destroying readInfo and writeInfo so that, if the
|
||||
/* If a read operation is in progress, we need to remove the handle
|
||||
* from the run loop and destroy the operation information so that
|
||||
* we won't generate a notification about it failing.
|
||||
*/
|
||||
if (readInfo)
|
||||
{
|
||||
[self ignoreReadDescriptor];
|
||||
DESTROY(readInfo);
|
||||
}
|
||||
|
||||
/* If a write operation is in progress, we need to remove the handle
|
||||
* from the run loop and destroy the operation information so that
|
||||
* we won't generate a notification about it failing.
|
||||
*/
|
||||
if ([writeInfo count] > 0)
|
||||
{
|
||||
[self ignoreWriteDescriptor];
|
||||
[writeInfo removeAllObjects];
|
||||
}
|
||||
|
||||
/* Finalize *after* ending read and write operations so that, if the
|
||||
* file handle needs to be closed, we don't generate any notifications
|
||||
* containing the deallocated object. Tnanks to david for this fix.
|
||||
* containing the deallocated object. Thanks to David for this fix.
|
||||
*/
|
||||
[self finalize];
|
||||
[super dealloc];
|
||||
|
|
Loading…
Reference in a new issue