Skip to content

Commit 59aa8e0

Browse files
author
siska
committed
Initialize plugin internals later
1 parent 949205a commit 59aa8e0

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

foo_np_adv/initquit.cpp

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
class npa_initquit : public initquit {
44
public:
55
void on_init() {
6+
IEvents::Initialize();
7+
IWriter::Initialize();
8+
for (t_size i = 0; i < IConfig::Count(); i++) {
9+
IEvents::UpdateInstance(IConfig::Get(i));
10+
}
611
console::info(COMMON_NAME " - plugin initialized");
712
}
813
void on_quit() {
@@ -22,21 +27,3 @@ class npa_initquit : public initquit {
2227
};
2328

2429
static initquit_factory_t<npa_initquit> g_npainitquit_factory;
25-
26-
class InitHandler : public init_stage_callback {
27-
public:
28-
void on_init_stage(t_uint32 stage) {
29-
switch (stage) {
30-
case init_stages::before_config_read:;
31-
IEvents::Initialize();
32-
IWriter::Initialize();
33-
break;
34-
case init_stages::after_config_read:;
35-
for (t_size i = 0; i < IConfig::Count(); i++) {
36-
IEvents::UpdateInstance(&IConfig::Get(i));
37-
}
38-
break;
39-
}
40-
}
41-
};
42-
static service_factory_single_t<InitHandler> initHandler;

0 commit comments

Comments
 (0)