[erlang-questions] How to properly stop complicated async NIF resource.

Mikael Karlsson karlsson.rm@REDACTED
Thu Jul 18 22:33:30 CEST 2019


> because if we get to destructor without calling erlang destructor, it
> means that we need to reboot whole program and after 5 times reboot whole
> device with power cycle.
>
> OK, this brings me a bit back to previous discussion about
enif_release_resource. If you do not call enif_release_resource in the same
function as when you do enif_allocate_resource but wait until you have
cleaned everything up with the  killing process ("erlang destructor") you
will make sure that garbage collection and destructor call will not happen
before this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190718/25d743fe/attachment.htm>


More information about the erlang-questions mailing list