From 5f341e839079da39a13662b71e26387d20b57fd0 Mon Sep 17 00:00:00 2001 From: Lex Trotman Date: Sat, 31 Mar 2012 19:58:24 -0700 Subject: [PATCH] Add note about static initialization of C++ classes --- vol_5/newsletter_5.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vol_5/newsletter_5.rst b/vol_5/newsletter_5.rst index b58a6fe..5b7767b 100644 --- a/vol_5/newsletter_5.rst +++ b/vol_5/newsletter_5.rst @@ -116,6 +116,12 @@ to C++:: dialogs_show_msgbox(GTK_MESSAGE_INFO, "%s", hello_message); } +It's important to note that the dynamic library loading mechanism that loads +plugins is C functionality and does not know about C++ constructors. This means +that global and static objects in the plugin will *not* have their constructors +called when the plugin is loaded. Use dynamically created objects as show in the +above example. + These changes will be available in the next Geany release but you can start using them right away in your C++ plugins if you Build Geany From Git [3].