From 6c415c67011532fc0fb7c3051a4cf657ea93dfe0 Mon Sep 17 00:00:00 2001 From: Patrick Venture Date: Wed, 14 Nov 2018 14:01:36 -0800 Subject: bugfix: load handlers and use factory symbol Use a predefined factory symbol to build each handler after loading the library. Change-Id: I0369c6e46a57c2e8533409d8b06eb74a3962434c Signed-off-by: Patrick Venture --- example/example.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'example/example.cpp') diff --git a/example/example.cpp b/example/example.cpp index 929e4d1..cc36e88 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -181,11 +181,17 @@ void setupExampleHandler() __attribute__((constructor)); void setupExampleHandler() { - auto* manager = getBlobManager(); - if (!manager->registerHandler(std::make_unique())) - { - log("Failed to register Example Handler"); - } + // You don't need to do anything in the constructor. } } // namespace blobs + +/** + * This method is required by the blob manager. + * + * It is called to grab a handler for registering the blob handler instance. + */ +std::unique_ptr createHandler() +{ + return std::make_unique(); +} -- cgit v1.2.3