From 76b4def27cf893cf25a7e72e7871180bd4bfd003 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 6 Nov 2013 14:00:16 +0100 Subject: wx: Fix crash in wxe_server cleanup Do not use disconnect event listener when we are exiting the port, it may interfere with window destructions and cause a crash. --- lib/wx/test/wx_xtra_SUITE.erl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/wx/test/wx_xtra_SUITE.erl') diff --git a/lib/wx/test/wx_xtra_SUITE.erl b/lib/wx/test/wx_xtra_SUITE.erl index a2d4c26319..8d5d7ddb6a 100644 --- a/lib/wx/test/wx_xtra_SUITE.erl +++ b/lib/wx/test/wx_xtra_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2012. All Rights Reserved. +%% Copyright Ericsson AB 2009-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -129,15 +129,19 @@ app_dies(_Config) -> app_dies2(Test, N) -> spawn_link(fun() -> Test(N) end), - receive - {'EXIT', _, {oops, last}} -> ok; - {'EXIT', _, {oops, _}} -> app_dies2(Test, N+1) + receive + {'EXIT', _, {oops, Server, What}} -> + Ref = erlang:monitor(process, Server), + receive {'DOWN', Ref, _, _, _} -> ok end, + timer:sleep(100), + What =/= last andalso app_dies2(Test, N+1) end. oops(Die, Line) when (Die =:= last) orelse (Die =< Line) -> - timer:sleep(300), + timer:sleep(200), ?log(" Exits at line ~p~n",[Line]), - exit({oops, Die}); + Server = element(3, wx:get_env()), + exit({oops, Server, Die}); oops(_,_) -> ok. -- cgit v1.2.3