summaryrefslogtreecommitdiff
path: root/lib/wx/src/wx_object.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wx/src/wx_object.erl')
-rw-r--r--lib/wx/src/wx_object.erl19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/wx/src/wx_object.erl b/lib/wx/src/wx_object.erl
index 81d188b26a..1a2d49faca 100644
--- a/lib/wx/src/wx_object.erl
+++ b/lib/wx/src/wx_object.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -235,7 +235,7 @@ start_link(Name, Mod, Args, Options) ->
gen_response(gen:start(?MODULE, link, Name, Mod, Args, [get(?WXE_IDENTIFIER)|Options])).
gen_response({ok, Pid}) ->
- receive {ack, Pid, Ref = #wx_ref{}} -> Ref end;
+ receive {started, Pid, Ref = #wx_ref{}} -> Ref end;
gen_response(Reply) ->
Reply.
@@ -407,30 +407,23 @@ init_it(Starter, Parent, Name, Mod, Args, [WxEnv|Options]) ->
{#wx_ref{} = Ref, State, Timeout} ->
init_it2(Ref, Starter, Parent, Name, State, Mod, Timeout, Debug);
{stop, Reason} ->
- proc_lib:init_ack(Starter, {error, Reason}),
exit(Reason);
ignore ->
- proc_lib:init_ack(Starter, ignore),
- exit(normal);
+ proc_lib:init_fail(Starter, ignore, {exit, normal});
{'EXIT', Reason} ->
- proc_lib:init_ack(Starter, {error, Reason}),
exit(Reason);
Else ->
- Error = {bad_return_value, Else},
- proc_lib:init_ack(Starter, {error, Error}),
- exit(Error)
+ exit({bad_return_value, Else})
end.
%% @hidden
init_it2(Ref, Starter, Parent, Name, State, Mod, Timeout, Debug) ->
ok = wxe_util:register_pid(Ref),
case ?CLASS_T(Ref#wx_ref.type, wxWindow) of
false ->
- Reason = {Ref, "not a wxWindow subclass"},
- proc_lib:init_ack(Starter, {error, Reason}),
- exit(Reason);
+ exit({Ref, "not a wxWindow subclass"});
true ->
proc_lib:init_ack(Starter, {ok, self()}),
- proc_lib:init_ack(Starter, Ref#wx_ref{state=self()}),
+ Starter ! {started, self(), Ref#wx_ref{state=self()}},
loop(Parent, Name, State, Mod, Timeout, Debug)
end.