Check if the window and it's gstate exist before undefining the gstate.

Patch by Georg Fleischmann <G.Fleischmann@vhf.de>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31350 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2010-09-15 08:21:32 +00:00
parent ed0d31d84e
commit a3eb0e0e6e
2 changed files with 20 additions and 4 deletions

View file

@ -1,8 +1,15 @@
2010-09-15 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSView.m (-releaseGState): Check if the window and it's
gstate exist before undefining the gstate.
Patch by Georg Fleischmann <G.Fleischmann@vhf.de>.
* 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 <german@xelalug.org>
* 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 <FredKiefer@gmx.de>
* Source/NSPrintOperation.m (-_printPaginateWithInfo:knowsRange:):

View file

@ -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;
}