Fixed thumbnail delete ordering issues (also found ffsup2).

Fixed minor memory leak found by valgrind.

Fixed thumbnail processing ordering issue.
This commit is contained in:
Steve Herrell
2010-11-15 20:56:26 -05:00
parent a9cd01f992
commit a9a8141b20
5 changed files with 20 additions and 8 deletions

View File

@@ -489,13 +489,16 @@ void Thumbnail::setFileName (const Glib::ustring fn) {
void Thumbnail::addThumbnailListener (ThumbnailListener* tnl) {
increaseRef();
listeners.push_back (tnl);
}
void Thumbnail::removeThumbnailListener (ThumbnailListener* tnl) {
std::vector<ThumbnailListener*>::iterator f = std::find (listeners.begin(), listeners.end(), tnl);
if (f!=listeners.end())
if (f!=listeners.end()) {
listeners.erase (f);
decreaseRef();
}
}