diff options
author | Mitchell Foral <unknown> | 2021-04-15 09:01:02 +1000 |
---|---|---|
committer | Mitchell Foral <unknown> | 2021-04-15 09:01:02 +1000 |
commit | c6d90475a1dc4fabd2be06768012fd48a32ecf46 (patch) | |
tree | 58bd7d6cb0a94d07d7c4066fae2147f2ea331371 | |
parent | 94db8c377f08529e4c49c828d2c75c826c51d52e (diff) | |
download | scintilla-mirror-c6d90475a1dc4fabd2be06768012fd48a32ecf46.tar.gz |
Avoid crash on Win32 as it doesn't support font options.
-rwxr-xr-x | gtk/ScintillaGTK.cxx | 10 |
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); } |