dispatcher: added discard to free explicitly a pool

This commit is contained in:
Michele Caini
2019-12-21 17:24:58 +01:00
parent 56e7dd0de0
commit 9457a55910
7 changed files with 26 additions and 22 deletions

View File

@@ -5,11 +5,14 @@
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
switch (operation) {
case CR_STEP:
static_cast<entt::dispatcher *>(ctx->userdata)->trigger<event>();
static_cast<entt::dispatcher *>(ctx->userdata)->trigger<message>(42);
break;
case CR_CLOSE:
static_cast<entt::dispatcher *>(ctx->userdata)->discard<event>();
break;
case CR_LOAD:
case CR_UNLOAD:
case CR_CLOSE:
// nothing to do here, this is only a test.
break;
}