aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2018-11-16 09:35:36 +0100
committerDan Gudmundsson <[email protected]>2018-11-16 11:34:40 +0100
commit2634c45c63dc6038ab9c738e9ab8ace490802f6d (patch)
treecde499a946a382087bbc579d25d36067729c5010 /lib/wx/api_gen
parentdb6059a9217767a6e42e93cec05089c0ec977d20 (diff)
downloadotp-2634c45c63dc6038ab9c738e9ab8ace490802f6d.tar.gz
otp-2634c45c63dc6038ab9c738e9ab8ace490802f6d.tar.bz2
otp-2634c45c63dc6038ab9c738e9ab8ace490802f6d.zip
wx: Do not delay deletes of wxGraphicContext
Fixes crash on Mojave, where refresh events are sent early and invoked recursively the delete of wxGraphicContext was delayed until after callback returned causing the crash to happen.
Diffstat (limited to 'lib/wx/api_gen')
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index 573abfa9b8..4261ebe7bc 100644
--- a/lib/wx/api_gen/wx_gen_cpp.erl
+++ b/lib/wx/api_gen/wx_gen_cpp.erl
@@ -995,8 +995,13 @@ build_ret_types(Type,Ps) ->
end,
lists:foldl(Calc, Free, Ps).
-build_ret(Name,_,#type{base={class,Class},single=true}) ->
- w(" rt.addRef(getRef((void *)~s,memenv), \"~s\");~n",[Name,Class]);
+build_ret(Name,_D,#type{base={class,Class},single=true}=_T) ->
+ case Class of
+ "wxGraphicsContext" ->
+ w(" rt.addRef(getRef((void *)~s,memenv,8), \"~s\");~n",[Name,Class]);
+ _ ->
+ w(" rt.addRef(getRef((void *)~s,memenv), \"~s\");~n",[Name,Class])
+ end;
build_ret(Name,_,#type{name="wxTreeItemId",single=true}) ->
w(" rt.add((wxUIntPtr *) ~s.m_pItem);~n",[Name]);
build_ret(Name,_,#type{name="wxTreeItemIdValue",single=true}) ->