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:
Philippe Houdoin 2011-02-26 01:37:44 +00:00
parent 30a498f4a6
commit 3d1ed0fb56

View File

@ -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(&notification) == B_OK) {
if (iterator->SendMessage(&notification) == 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(&notification) == B_OK) {
if (target->SendMessage(&notification) == B_OK && entry != NULL) {
entry->bitmapOwner->AcquireReference();
// this is the reference owned by the target
}