diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-09-08 15:51:37 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-09-08 15:51:37 (GMT) |
commit | 0c250450d168316ff91d1c0bda5e371d38edb6a7 (patch) | |
tree | 502153950ed2924a69ceb980be42cb321072e396 | |
parent | 083bcc35ae8b215f53d336a8863c73042e1e3d89 (diff) |
Correctly dispose some DSObject instances.
-rwxr-xr-x | journalactivity.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/journalactivity.py b/journalactivity.py index 578f784..0369616 100755 --- a/journalactivity.py +++ b/journalactivity.py @@ -148,15 +148,24 @@ class JournalActivity(activity.Activity): self._toolbox.set_current_toolbar(0) def _data_store_created_cb(self, uid): - self._check_for_bundle(uid) + jobject = datastore.get(uid) + if jobject is None: + return + try: + self._check_for_bundle(jobject) + finally: + jobject.destroy() def _data_store_updated_cb(self, uid): - self._check_for_bundle(uid) - - def _check_for_bundle(self, uid): jobject = datastore.get(uid) if jobject is None: return + try: + self._check_for_bundle(jobject) + finally: + jobject.destroy() + + def _check_for_bundle(self, jobject): if not (jobject.is_bundle() or jobject.is_content_bundle()): return if jobject.file_path == '': |