This is the de facto state of affairs
and makes the plugin interface cleaner.
Change-Id: I24cb1625945fae2ef4a7dbb5b4e5e232edb6c911
#include "main_context.hpp"
#include <stdexcept>
+std::unique_ptr <sessiond_context> g_sessiond_context;
+
int main() try {
- sessiond_context().run();
+ g_sessiond_context = std::make_unique <sessiond_context> ();
+ g_sessiond_context->run();
} catch (const std::exception &ex) {
LOGE("Exception %s caught in top scope! Bailing out...", ex.what());
return EXIT_FAILURE;
#include <dlog.h>
#include <algorithm>
+#include <memory>
#include <unordered_map>
#include <gio/gio.h>
main_loop loop;
GDBusConnection *connection = nullptr;
};
+
+/* The struct is effectively a singleton, but all the usual code (getter etc)
+ * are missing because this was a change late in development. */
+extern std::unique_ptr <sessiond_context> g_sessiond_context;