diff options
author | mitchell <70453897+orbitalquark@users.noreply.github.com> | 2022-01-12 18:36:16 -0500 |
---|---|---|
committer | mitchell <70453897+orbitalquark@users.noreply.github.com> | 2022-01-12 18:36:16 -0500 |
commit | af01f807e232307f70bb1b8f007b7e65f8d66899 (patch) | |
tree | f7ba9930894ab5ad6a517bcad862adad2c369552 /src | |
parent | f4d8b6036ef7e631ee87ae5f89709fb798818fea (diff) |
Fixed menubar reset crash on macOS.
Temporary workaround is to prevent changing the menubar after it is set.
Diffstat (limited to 'src')
-rw-r--r-- | src/textadept.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/textadept.c b/src/textadept.c index a4ab9ef6..3daabdc7 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -888,6 +888,12 @@ static int ui_newindex(lua_State *L) { set_statusbar_text(lua_tostring(L, 3), *key == 's' ? 0 : 1); else if (strcmp(key, "menubar") == 0) { #if GTK +#if __APPLE__ + // TODO: gtkosx_application_set_menu_bar does not like being called more than once in an app. + // Random segfaults will happen after a second reset, even if menubar is g_object_ref/unrefed + // properly. + if (lua_getglobal(L, "arg") == LUA_TNIL) return 0; +#endif luaL_argcheck(L, lua_istable(L, 3), 3, "table of menus expected"); for (size_t i = 1; i <= lua_rawlen(L, 3); lua_pop(L, 1), i++) luaL_argcheck(L, lua_rawgeti(L, 3, i) == LUA_TLIGHTUSERDATA, 3, |