summaryrefslogtreecommitdiff
path: root/plugin.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2020-06-29 09:29:06 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2020-06-29 09:29:06 +0200
commit5193fd9d9945437fbc7663f1585ae5d96d2ba103 (patch)
treea8a634140a849b64e21675bb726bf01609fa38cd /plugin.h
parenta526eee1651ca643a3f3c88a0c852a43261a7ebb (diff)
downloadvdr-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.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugin.h b/plugin.h
index 3502741a..64632c55 100644
--- a/plugin.h
+++ b/plugin.h
@@ -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();