Skip to content

Commit a2ba5e2

Browse files
committed
Make sure terminate/2 is called in config
The callback was not called as we didn't trap exits. This is not a big deal at runtime, as the process would go down anyway after config app terminates, and even if it restarts, we'd clean up all the config values anyway in init. However, when running tests this could leave config value set from the previous config app run.
1 parent 6df21c5 commit a2ba5e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/config/src/config.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ subscribe_for_changes(Subscription) ->
276276
config_notifier:subscribe(Subscription).
277277

278278
init(IniFilesDirs) ->
279+
% trap exits to make sure terminate/2 gets called
280+
process_flag(trap_exit, true),
279281
enable_early_features(),
280282
erase_all(),
281283
IniFiles = expand_dirs(IniFilesDirs),

0 commit comments

Comments
 (0)