1

I'm trying to implement an application with wxWidgets in Erlang/OTP. For the sake of this question, I'll show the simple example:

I create a new wx server with wx:new(). in the terminal. Then using i(). I display the ETS tables on the terminal. I can see the following gen_servers and wxWidgets in the end of the output:

...
<0.80.0>              erlang:apply/2                        1598    38630    0
                      c:pinfo/1                               49
<0.82.0>              wxe_server:init/1                      233      176    0
                      gen_server:loop/7                       12
<0.83.0>              wxe_master:init/1                     2586     2120    0
wxe_master            gen_server:loop/7                       12
<0.84.0>              erlang:apply/2                         233     1466    0
                      timer:sleep/1                            5
<0.84.0>              erlang:apply/2                         233     1466    0
                      timer:sleep/1                            5
Total                                                      37228   251519    0
                                                             401

After killing the wx server with wx:destroy()., the server is dead but the wxe_master is still alive:

...
<0.80.0>              erlang:apply/2                        1598    79610    0
                      c:pinfo/1                               49
<0.83.0>              wxe_master:init/1                     2586     2121    0
wxe_master            gen_server:loop/7                       12
<0.84.0>              erlang:apply/2                         233     4735    0
                      timer:sleep/1                            5
<0.84.0>              erlang:apply/2                         233     4735    0
                      timer:sleep/1                            5
Total                                                      38594   349967    0
                                                             389

What is the correct way of killing the entire wx server completely without leaving any processes behind?

StickySli
  • 81
  • 8

0 Answers0