discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage problem


From: Andreas Höschler
Subject: NSImage problem
Date: Thu, 17 Nov 2005 19:49:44 +0100

Hello all,

my app is behaving badly and crashing after closing the login panel. While tracking this down I found out that it must have to do with NSImage handling. The following code in NSImage.m

- (void) lockFocusOnRepresentation: (NSImageRep *)imageRep
{
  if (_cacheMode != NSImageCacheNever)
    {
     NSLog(@"lockFocusOnRepresentation %@", imageRep);

     NSWindow   *window;
      GSRepData *repd;

if (imageRep == nil) imageRep = [self bestRepresentationForDevice: nil];
      NSLog(@"A %@", imageRep);
      imageRep = [self _cacheForRep: imageRep];
      NSLog(@"B %@", imageRep);
      repd = repd_for_rep(_reps, imageRep);
      NSLog(@"C %@", imageRep);
      window = [(NSCachedImageRep *)imageRep window];
      _lockedView = [window contentView];
      if (_lockedView == nil)
        {
         NSLog(@"Window %@ has no contentView!", window);
[NSException raise:NSImageCacheException format:@"Cannot lock focus on nil rep"];
        }
      [_lockedView lockFocus];
        ...

produces the following output when I do a right mouse-click on the app icon to get access to the menu (see mail GNUstep Observations).

2005-11-17 19:42:33.062 SmartClient[2327] compositeToPoint <NSImage: 51f488> 2005-11-17 19:42:33.062 SmartClient[2327] lockFocusOnRepresentation <NSCachedImageRep: 16b010>
2005-11-17 19:42:33.062 SmartClient[2327] A <NSCachedImageRep: 16b010>
2005-11-17 19:42:33.062 SmartClient[2327] B (nil)
2005-11-17 19:42:33.062 SmartClient[2327] C (nil)
2005-11-17 19:42:33.063 SmartClient[2327] Window (nil) has no contentView! 2005-11-17 19:42:33.063 SmartClient[2327] NSImage: compositeToPoint:fromRect:operation: failed due to ImageCache: Cannot lock focus on nil rep
...
2005-11-17 19:42:33.066 SmartClient[2327] NSImage: compositeToPoint:fromRect:operation: failed due to NSInvalidArgumentException: Tried to init array with nil object
recursion encountered handling uncaught exception

I have my app in the dock. The icon is a red ball. When I start the app with openapp in a terminal the app icon (its contents) in the dock vanishes - gray empty square - and instead appears at the bottom of the screen. Weird! When I open the login panel, the app menu vanishes. Weird! When I press ok in the login panel the app menu reappears shortly and vanishes again after the method behind the ok button has completed. All I can do now is right-mouse click on the app icon - at the bottom of the screen; the empty icon in the dock does not work - but this crashes the app (see above).

I am puzzled! Any ideas?

Regards,

  Andreas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]