mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 19:20:37 +00:00
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:
parent
c75954f582
commit
ce2180918a
2 changed files with 20 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue