Skip to content

Commit 780b8ab

Browse files
committed
Implement no-op erl init upgrade callback
1 parent 237e4f2 commit 780b8ab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

c_src/sqlite3_nif.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,16 @@ on_unload(ErlNifEnv* caller_env, void* priv_data)
12111211
enif_mutex_destroy(log_hook_mutex);
12121212
}
12131213

1214+
// We don't need to upgrade anything yet
1215+
// See: https://www.erlang.org/docs/28/apps/erts/erl_nif.html#initialization
1216+
static int
1217+
on_upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info)
1218+
{
1219+
assert(env);
1220+
1221+
return 0;
1222+
}
1223+
12141224
//
12151225
// Enable extension loading
12161226
//
@@ -1469,4 +1479,4 @@ static ErlNifFunc nif_funcs[] = {
14691479
{"errstr", 1, exqlite_errstr},
14701480
};
14711481

1472-
ERL_NIF_INIT(Elixir.Exqlite.Sqlite3NIF, nif_funcs, on_load, NULL, NULL, on_unload)
1482+
ERL_NIF_INIT(Elixir.Exqlite.Sqlite3NIF, nif_funcs, on_load, NULL, on_upgrade, on_unload)

0 commit comments

Comments
 (0)