mirror of
https://github.com/correl/rebar.git
synced 2024-11-27 11:09:55 +00:00
Fix basic_nif on_load()
This commit is contained in:
parent
af3eab6522
commit
b594d356e1
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
#include "erl_nif.h"
|
#include "erl_nif.h"
|
||||||
|
|
||||||
static ErlNifResourceType* {{module}}_RESOURCE;
|
static ErlNifResourceType* {{module}}_RESOURCE = NULL;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -51,6 +51,8 @@ static int on_load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
|
||||||
if (rt == NULL)
|
if (rt == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
{{module}}_RESOURCE = rt;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue