diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2020-06-29 09:29:06 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2020-06-29 09:29:06 +0200 |
commit | 5193fd9d9945437fbc7663f1585ae5d96d2ba103 (patch) | |
tree | a8a634140a849b64e21675bb726bf01609fa38cd /plugin.h | |
parent | a526eee1651ca643a3f3c88a0c852a43261a7ebb (diff) | |
download | vdr-5193fd9d9945437fbc7663f1585ae5d96d2ba103.tar.gz vdr-5193fd9d9945437fbc7663f1585ae5d96d2ba103.tar.bz2 |
Improved deleting plugins in case the plugin uses its own memory management
Diffstat (limited to 'plugin.h')
-rw-r--r-- | plugin.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: plugin.h 2.2 2012/09/01 13:08:54 kls Exp $ + * $Id: plugin.h 4.1 2020/06/29 09:29:06 kls Exp $ */ #ifndef __PLUGIN_H @@ -15,7 +15,9 @@ #include "osdbase.h" #include "tools.h" -#define VDRPLUGINCREATOR(PluginClass) extern "C" void *VDRPluginCreator(void) { return new PluginClass; } +#define VDRPLUGINCREATOR(PluginClass) \ + extern "C" void *VDRPluginCreator(void) { return new PluginClass; } \ + extern "C" void VDRPluginDestroyer(PluginClass *p) { delete p; } class cPlugin { friend class cDll; @@ -71,6 +73,8 @@ private: char *args; void *handle; cPlugin *plugin; + typedef void destroy_t(cPlugin *); + destroy_t *destroy; public: cDll(const char *FileName, const char *Args); virtual ~cDll(); |