Anonymous avatar Anonymous committed af6eb76

refactoring in the attempt to find a memleak.

Comments (0)

Files changed (1)

 
 ### Imports ###
 
+#import objgraph# find memleaks
+
 # First the basic python stuff
 # for starting programs
 import subprocess
         if self.editor.main.isVisible():
             return None
         
+        print objgraph.show_growth()
+
         # Get the position
         pos = event.pos()
 
+        clicked = None
         for i in self.circle[:]:
             if self.isInside(pos, i):
-                # If pyRad didn't reach a final action, we stop here.
-                if event.button() == Qt.LeftButton:
-                    if self.labelClicked(i) is None:
-                        break # TODO: Check if we can use return None instead
-                elif event.button() == Qt.RightButton and i != self.circle[0]:
-                    self.editLabel(i)
-                    break
-                elif event.button() == Qt.RightButton and i == self.circle[0]:# and i.action is None: # only in the top wheel.
-		    # TODO: right-click on the middle item should show the options. 
-		    # currently we just don't edit it. 
-                    self.editor_config.config()
-                    break
-		elif event.button() == Qt.MidButton:
-                    self.addLabelAfter(i)
-                    break
-                else: # other buttons are ignored
-                    break
+                clicked = i
 
-                # Otherwise we can hide the pyRad
+        if not clicked:
+            # Otherwise we can hide the pyRad
+            self.hide()
+
+        # If pyRad didn't reach a final action, we stop here.
+        if event.button() == Qt.LeftButton:
+            if self.labelClicked(clicked) is None:
+                return # TODO: Check if we can use return None instead
+            else: 
                 self.hide()
-                
+        elif event.button() == Qt.RightButton and clicked != self.circle[0]:
+            self.editLabel(clicked)
+            return
+        elif event.button() == Qt.RightButton and clicked == self.circle[0]:# and i.action is None: # only in the top wheel.
+            # TODO: right-click on the middle item should show the options. 
+            # currently we just don't edit it. 
+            self.editor_config.config()
+            return
+        elif event.button() == Qt.MidButton:
+            self.addLabelAfter(clicked)
+            return
+        else: # other buttons are ignored
+            return
+
+            
     def keyReleaseEvent(self, event):
         """Select items via keyboard."""
         # Debug: Don't react, if an edit dialog is open.
         # First remove the previous items
         for label in self.circle[:]:
             label.hide()
+            label.clear()
+            label.close()
             label.destroy()
+            #del label
+        #if self.circle:
+            #i = self.circle[0]
+            #self.circle = []
+            #objgraph.show_backrefs([i])
+        
 
         # Then create the circle list
         self.circle = self.items_to_circle(items)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.