Sat 31 Jan 2009 01:05:18 AM UTC, comment #7:
Unfortunately that doesn't seem to have solved the problem. Here's the entire code of our setImage: method in case it might help:
- (void) setImage: (NSImage *) anImage {
[[self internalImageView] setImage: anImage];
if (anImage) {
[self setupInternalViews];
[self setToolTip:[NSString stringWithFormat:@"Image Size: %d x %d",(int)[anImage size].width,(int)[anImage size].height]];
}
}
Our internalImageView is an NSImageView that is our subview which actually displays the image. It is only created once.
Our setupInternalViews method just sizes and positions the internalImageView and another subview. The only part of that method that seems like it might have a bearing on this reads:
[[self internalImageView] setFrame:innerBounds];
[[self internalImageView] setImageScaling:NSScaleProportionally];
[[self internalImageView] setImageAlignment:NSImageAlignCenter];
I don't see any likely culprits there. Our custom image view is loaded as a Custom View object within a nib file. I suppose it's possible that is related to the problem although it seems like a bit of a stretch since the tooltip works at first (and our image isn't set until later).
|
Fri 30 Jan 2009 02:46:10 PM UTC, comment #6:
I still can't reproduce this ... I've tried setting a tooltip on an NSImageView, then changing the tooltip with another call to setToolTip: and that won;t produce a crash ... so it has to be more than just setting a tool tip twice.
However, I noticed that when tracking rectangles were removed from a view, the code was not invalidating them. I changed that as it looked wrong, and might conceivably be the cause of your problem.
What would help most would be a small test application which reliably produces the bug ad which I could run under debug.
|
Wed 28 Jan 2009 03:26:15 PM UTC, comment #5:
Okay, ignore most of what I said yesterday. I've been able to reliably produce this crash in my app now, and it seems likely that it has more to do with tooltips than with tracking rectangles.
The crash occurs in this way: I call [self setTooltip:] in a private subclass of NSImageView (in an overridden setImage: method). It works fine the first time, but when my setImage: method is called again to switch images and I call setTooltip: a second time (with information about the new image's size) then I get this crash upon moving the mouse over the image.
I hope that helps to track down the problem.
|
Tue 27 Jan 2009 04:51:40 PM UTC, comment #4:
Unfortunately, I got this same crash again last night. The window in which it is occurring contains a tabView with two splitViews, an outlineView and a tableView as well as a couple buttons and a search field. Oh, and a custom view. :-)
So I'm really not sure which controls are registering cursor tracking rectangles with the window that might be related to the problem (I expect at least the splitViews and the field have cursor rects). Anyway, if there's anything you'd like me to examine in gdb the next time it crashes, let me know. I just don't know what to look for.
Hmm, it just occurred to me that it might even be related to cursor rectangles registered by controls on one of the other tabs in this window. The window has several tabs, with each tab view containing a number of controls. Just prior to the current crash, I had clicked a button (in a different window) that caused this window to come to the front and select this particular tab. So I wonder if it might be not properly resetting rectangles from controls that are swapped out at this point... just a thought.
Also, our custom cursor rectangles (in a different window) don't seem to be working (cursor isn't changing), so I wonder if the tracking rectangle code needs some attention, although this may be completely unrelated.
|
Fri 23 Jan 2009 10:44:32 PM UTC, comment #2:
Sorry for the lack of details. Actually, I gave you most of it (the backtrace is pretty minimal), but here's the details. I'm running on the tip (I believe gui is at rev 27656, if I'm reading the svn info correctly). Here's the backtrace:
#0 0xb76245b4 in objc_msg_lookup () from /usr/lib/libobjc.so.2
#1 0xb7ebd4ec in -[GSToolTips mouseEntered:] (self=0x924ab80, _cmd=0xb7f905c0, theEvent=0x8c8c348)
at GSToolTips.m:242
#2 0xb7e4168c in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
theView=0x9214928, theEvent=0x8c7dbb8) at NSWindow.m:3308
#3 0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
theView=0x92146f8, theEvent=0x8c7dbb8) at NSWindow.m:3361
#4 0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
theView=0x92144e0, theEvent=0x8c7dbb8) at NSWindow.m:3361
#5 0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
theView=0x92114a8, theEvent=0x8c7dbb8) at NSWindow.m:3361
#6 0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
theView=0x9211278, theEvent=0x8c7dbb8) at NSWindow.m:3361
#7 0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
theView=0x9211068, theEvent=0x8c7dbb8) at NSWindow.m:3361
#8 0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
theView=0x92109f8, theEvent=0x8c7dbb8) at NSWindow.m:3361
#9 0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
theView=0x9210ab8, theEvent=0x8c7dbb8) at NSWindow.m:3361
#10 0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
theView=0x9253068, theEvent=0x8c7dbb8) at NSWindow.m:3361
#11 0xb7e42ded in -[NSWindow sendEvent:] (self=0x9252f70, _cmd=0xb7ef6b70, theEvent=0x8c7dbb8)
at NSWindow.m:3667
---Type <return> to continue, or q <return> to quit---
#12 0xb7cab7af in -[NSApplication sendEvent:] (self=0x8422cb0, _cmd=0xb7ef6ab0, theEvent=0x8c7dbb8)
at NSApplication.m:1920
#13 0xb7caa238 in -[NSApplication run] (self=0x8422cb0, _cmd=0xb7eec160) at NSApplication.m:1420
#14 0xb7c8be11 in NSApplicationMain (argc=1, argv=0xbffbc864) at Functions.m:74
#15 0x0804fca2 in main (argc=Cannot access memory at address 0x1000c
) at main.m:13
theEvent is a mouseMoved event. Hopefully that's enough to help you track this down. Thanks!
|