emitter: added discard to free explicitly a pool

This commit is contained in:
Michele Caini
2019-12-21 17:32:17 +01:00
parent 9457a55910
commit 95fd4e4c99
7 changed files with 27 additions and 21 deletions

View File

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