diff --git a/ChangeLog b/ChangeLog index 1678d27cf..1fee403a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,15 @@ +2010-09-15 Fred Kiefer + + * Source/NSView.m (-releaseGState): Check if the window and it's + gstate exist before undefining the gstate. + Patch by Georg Fleischmann . + * Source/NSView.m (-_viewWillMoveToWindow:): Call [-releaseGState]. + 2010-09-13 Riccardo Mottola * Source/NSBitmapImageRep+JPEG.m: remove useless double statement * Source/tiff.m: remove unused variable and assignment - + 2010-09-12 German Arias * Panels/Spanish.lproj/GSFindPanel.gorm: Fixed a misspelling. * Source/NSFontPanel: Changed the width of size's column to @@ -4138,7 +4145,7 @@ * Source/NSPrintOperation.m (-_printPaginateWithInfo:knowsRange:, -_print): Try to handle not set print information more graceful. - + 2009-07-14 Fred Kiefer * Source/NSPrintOperation.m (-_printPaginateWithInfo:knowsRange:): diff --git a/Source/NSView.m b/Source/NSView.m index f0c5bf111..62f86969e 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -383,6 +383,12 @@ GSSetDragTypes(NSView* obj, NSArray *types) { return; } + + // This call also reset _allocate_gstate, but then want + // would that setting mean in a different window? + // This way we keep the logic in one place. + [self releaseGState]; + if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); @@ -2183,8 +2189,11 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1, */ - (void) releaseGState { - if (_allocate_gstate && _gstate) - GSUndefineGState([_window graphicsContext], _gstate); + if (_allocate_gstate && _gstate && + _window && ([_window graphicsContext] != nil)) + { + GSUndefineGState([_window graphicsContext], _gstate); + } _gstate = 0; _allocate_gstate = NO; }