summaryrefslogtreecommitdiff
path: root/plugin.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2020-12-13 10:56:36 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2020-12-13 10:56:36 +0100
commit67a4ba4228d878fe7f5484ab8d80178ca51ce6e6 (patch)
treed0a7c3c74b557f4f93ff12ad78d0bed32f585939 /plugin.c
parent79a3607d0c220797ebf9449dd2d49221e2761fda (diff)
downloadvdr-67a4ba4228d878fe7f5484ab8d80178ca51ce6e6.tar.gz
vdr-67a4ba4228d878fe7f5484ab8d80178ca51ce6e6.tar.bz2
Fixed error handling when loading a plugin
Diffstat (limited to 'plugin.c')
-rw-r--r--plugin.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugin.c b/plugin.c
index 0e0f2d13..cad2cd56 100644
--- a/plugin.c
+++ b/plugin.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: plugin.c 4.2 2020/06/29 09:29:06 kls Exp $
+ * $Id: plugin.c 4.3 2020/12/13 10:56:36 kls Exp $
*/
#include "plugin.h"
@@ -229,9 +229,12 @@ bool cDll::Load(bool Log)
if (!error) {
typedef cPlugin *create_t(void);
create_t *create = (create_t *)dlsym(handle, "VDRPluginCreator");
- if (!(error = dlerror()))
+ error = dlerror();
+ if (!error && create) {
plugin = create();
- destroy = (destroy_t *)dlsym(handle, "VDRPluginDestroyer");
+ destroy = (destroy_t *)dlsym(handle, "VDRPluginDestroyer");
+ error = dlerror();
+ }
}
if (!error) {
if (plugin && args) {