aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk
diff options
context:
space:
mode:
authorMitchell Foral <unknown>2021-04-15 09:01:02 +1000
committerMitchell Foral <unknown>2021-04-15 09:01:02 +1000
commitc6d90475a1dc4fabd2be06768012fd48a32ecf46 (patch)
tree58bd7d6cb0a94d07d7c4066fae2147f2ea331371 /gtk
parent94db8c377f08529e4c49c828d2c75c826c51d52e (diff)
downloadscintilla-mirror-c6d90475a1dc4fabd2be06768012fd48a32ecf46.tar.gz
Avoid crash on Win32 as it doesn't support font options.
Diffstat (limited to 'gtk')
-rwxr-xr-xgtk/ScintillaGTK.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 3acae3c0d..46655d785 100755
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -181,10 +181,12 @@ FontOptions::FontOptions(GtkWidget *widget) noexcept {
PLATFORM_ASSERT(pcontext);
const cairo_font_options_t *options = pango_cairo_context_get_font_options(pcontext);
// options is owned by the PangoContext so must not be freed.
- PLATFORM_ASSERT(options);
- antialias = cairo_font_options_get_antialias(options);
- order = cairo_font_options_get_subpixel_order(options);
- hint = cairo_font_options_get_hint_style(options);
+ if (options) {
+ // options is NULL on Win32
+ antialias = cairo_font_options_get_antialias(options);
+ order = cairo_font_options_get_subpixel_order(options);
+ hint = cairo_font_options_get_hint_style(options);
+ }
g_object_unref(pcontext);
}