[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Solang-devel] [PATCH] Added a PhotoFactory
From: |
Debarshi Ray |
Subject: |
[Solang-devel] [PATCH] Added a PhotoFactory |
Date: |
Sat, 13 Mar 2010 10:48:16 +0200 |
http://rishi.fedorapeople.org/0001-Added-a-PhotoFactory.patch
Currently photos are instanciated in the database when a query returns
a bunch of URIs and they get destructed when the last reference is
dropped. It is possible that the same URI is represented by two
separate instances of Photo -- one in the export queue and another
created from the results of a new query. For consistency it is better
to have only one Photo instance represent a particular URI at any
time.
Instances of Photo should be created using PhotoFactory::create_photo.
The PhotoFactory is not thread-safe as we are constructing or
destructing photos only from the main thread. The PhotoFactory keeps a
std::map of uris and WeakPhotoPtrs. When the last PhotoPtr referring
to a particular Photo instance is dropped the corresponding
WeakPhotoPtr is removed from the std::map. Therefore all PhotoPtrs
should be destructed before the PhotoFactory.
Added a Thumbnailer::shutdown, which should be invoked before the
PhotoFactory is destructed.
--
One reason that life is complex is that it has a real part and an
imaginary part.
-- Andrew Koenig
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Solang-devel] [PATCH] Added a PhotoFactory,
Debarshi Ray <=