changeset 22:88cea66228d6 traipse_dev

Should fix Image Chache problem, does not fix memory leak.
author sirebral
date Sat, 25 Jul 2009 20:36:12 -0500
parents fdd70f11bc7e
children 551cd440acce
files orpg/mapper/images.py orpg/orpg_version.py
diffstat 2 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/orpg/mapper/images.py	Sat Jul 25 19:28:21 2009 -0500
+++ b/orpg/mapper/images.py	Sat Jul 25 20:36:12 2009 -0500
@@ -122,23 +122,23 @@
         finally: self.__lock.release()
 
     def __loadCacheThread(self, path, image_type, imageId):
-        try:
-            st = time.time()
-            while self.__fetching.has_key(path) and self.__fetching[path] is not False:
-                time.sleep(0.025)
-                if (time.time()-st) > 120:
-                    open_rpg.get_component('log').log("Timeout: " + path, ORPG_GENERAL, True)
-                    break
-        except:
-            self.__fetching[path] = False
-            open_rpg.get_component('log').log("Unable to resolve/open the specified URI; image was NOT loaded: " + path, 
-                ORPG_GENERAL, True)
-            return 
-        self.__lock.acquire()
-        try:
-            open_rpg.get_component('log').log("Adding Image to Queue from Cache: " + str(self.__cache[path]), ORPG_DEBUG)
-            self.__queue.put((self.__cache[path], image_type, imageId))
-        finally: self.__lock.release()
+        if self.__cache.has_key(path):
+            try:
+                st = time.time()
+                while self.__fetching.has_key(path) and self.__fetching[path] is not False:
+                    time.sleep(0.025)
+                    if (time.time()-st) > 120:
+                        open_rpg.get_component('log').log("Timeout: " + path, ORPG_GENERAL, True)
+                        break
+            except:
+                del self.__fetching[path]
+                open_rpg.get_component('log').log("Unable to resolve/open the specified URI; image was NOT loaded: " + path, ORPG_GENERAL, True)
+                return 
+            self.__lock.acquire()
+            try:
+                open_rpg.get_component('log').log("Adding Image to Queue from Cache: " + str(self.__cache[path]), ORPG_DEBUG)
+                self.__queue.put((self.__cache[path], image_type, imageId))
+            finally: self.__lock.release()
 
 #Property Methods
     def _getCache(self):
--- a/orpg/orpg_version.py	Sat Jul 25 19:28:21 2009 -0500
+++ b/orpg/orpg_version.py	Sat Jul 25 20:36:12 2009 -0500
@@ -4,7 +4,7 @@
 #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed)
 DISTRO = "Traipse Dev"
 DIS_VER = "Grumpy Goblin"
-BUILD = "090725-02"
+BUILD = "090725-03"
 
 # This version is for network capability.
 PROTOCOL_VERSION = "1.2"