Fix ShowImage crash when image loading fail: we don't have a CacheEntry then, but still
should notify our listener (of the error, in such case). Closes #6842. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40692 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
30a498f4a6
commit
3d1ed0fb56
@ -318,7 +318,7 @@ ImageCache::_NotifyListeners(CacheEntry* entry, QueueEntry* queueEntry)
|
||||
|
||||
std::set<BMessenger>::iterator iterator = queueEntry->listeners.begin();
|
||||
for (; iterator != queueEntry->listeners.end(); iterator++) {
|
||||
if (iterator->SendMessage(¬ification) == B_OK) {
|
||||
if (iterator->SendMessage(¬ification) == B_OK && entry != NULL) {
|
||||
entry->bitmapOwner->AcquireReference();
|
||||
// this is the reference owned by the target
|
||||
}
|
||||
@ -335,7 +335,7 @@ ImageCache::_NotifyTarget(CacheEntry* entry, const BMessenger* target)
|
||||
BMessage notification(kMsgImageCacheImageLoaded);
|
||||
_BuildNotification(entry, notification);
|
||||
|
||||
if (target->SendMessage(¬ification) == B_OK) {
|
||||
if (target->SendMessage(¬ification) == B_OK && entry != NULL) {
|
||||
entry->bitmapOwner->AcquireReference();
|
||||
// this is the reference owned by the target
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user