[Pyobjc-dev] tableview crash
Brought to you by:
ronaldoussoren
From: Burris T. E. <bu...@gi...> - 2004-03-19 05:46:23
|
Forgive me, my Cocoa is pretty rusty... I have a single column NSTableView using an NSCell subclass. The cell gets a reference to a view (a box of regular controls) in setObjectValue_ Each row has a worker thread, started with start_new_thread, that posts a method and arguments onto a queue. I have an NSTimer going off in the main thread that pulls the methods off the queue, which update the views that are displayed in the cell. When there is more than one row in the TV I get a strange crash shortly after selecting rows in quick succession or in dragging on a row (the TV is set to single selection and no rearranging of rows). Usually in the cell's drawInteriorWithFrame_inView_ the attribute containing the content view will disappear mid-method. Or an extra argument will show up in the NSTimer fired event loop. Now I'm getting "Fatal Python error: GC object already tracked" I think I'm running latest CVS and built in 2.3 on 10.3.2 Any help would be appreciated! interesting bits from cell: def setObjectValue_(self, controller): self.controller = controller def drawInteriorWithFrame_inView_(self, frame, view): if self.controller.cview.superview() != view: view.addSubview_(self.controller.cview) if self.controller.resized: self.controller.resized = 0 self.controller.cview.setFrame_(frame) self.controller.cview.lockFocus() self.controller.cview.drawRect_(frame) self.controller.cview.unlockFocus() interesting bits from the controller: def handleEvents_(self, timer): while self.events: self.event_lock.acquire() f, args, kwargs = self.events.pop() self.event_lock.release() try: f(*args,**kwargs) except: print_exc() if not self.flag.isSet(): NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_ (0.2, self, self.handleEvents_, self, 0) burris |