cocoadisplay: don't crash if window/buffer fails to open
This commit is contained in:
parent
eb960669a5
commit
57602d750f
|
|
@ -105,6 +105,12 @@ open_buffer() {
|
|||
}
|
||||
}
|
||||
|
||||
if (cocoagsg->_context == nil) {
|
||||
// Could not obtain a proper context.
|
||||
_gsg.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
FrameBufferProperties desired_props(_fb_properties);
|
||||
|
||||
// Lock the context, so we can safely operate on it.
|
||||
|
|
|
|||
|
|
@ -362,6 +362,13 @@ open_window() {
|
|||
}
|
||||
}
|
||||
|
||||
if (cocoagsg->_context == nil) {
|
||||
// Could not obtain a proper context.
|
||||
_gsg.clear();
|
||||
close_window();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Fill in the blanks.
|
||||
if (!_properties.has_origin()) {
|
||||
_properties.set_origin(-2, -2);
|
||||
|
|
|
|||
Loading…
Reference in New Issue