mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Do not call handler blocks if they are nil
This commit is contained in:
parent
e68b97d58b
commit
5b151c5fa0
12 changed files with 32 additions and 33 deletions
|
@ -3579,7 +3579,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
{
|
||||
if (deallocator != NULL)
|
||||
{
|
||||
CALL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, length);
|
||||
CALL_NON_NULL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, length);
|
||||
DESTROY(deallocator);
|
||||
}
|
||||
// Clear out the ivars so that super doesn't double free.
|
||||
|
@ -4442,7 +4442,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
{
|
||||
if (deallocator != NULL)
|
||||
{
|
||||
CALL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, capacity);
|
||||
CALL_NON_NULL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, capacity);
|
||||
// Clear out the ivars so that super doesn't double free.
|
||||
bytes = NULL;
|
||||
length = 0;
|
||||
|
@ -4472,7 +4472,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
memcpy(tmp, bytes, capacity < size ? capacity : size);
|
||||
if (deallocator != NULL)
|
||||
{
|
||||
CALL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, capacity);
|
||||
CALL_NON_NULL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, capacity);
|
||||
DESTROY(deallocator);
|
||||
zone = NSDefaultMallocZone();
|
||||
}
|
||||
|
@ -4483,7 +4483,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
}
|
||||
else if (deallocator != NULL)
|
||||
{
|
||||
CALL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, capacity);
|
||||
CALL_NON_NULL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, capacity);
|
||||
DESTROY(deallocator);
|
||||
zone = NSDefaultMallocZone();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue