From patchwork Wed May 24 17:45:41 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Grimm X-Patchwork-Id: 12317 Received: from moutng.kundenserver.de ([212.227.126.186]) by www.linuxtv.org with esmtp (Exim 4.50) id 1FixQW-0004Tv-2l for vdr@linuxtv.org; Wed, 24 May 2006 19:45:44 +0200 Received: from [84.184.47.93] (helo=[192.168.30.10]) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1FixQU22Lh-0003eL; Wed, 24 May 2006 19:45:42 +0200 Message-ID: <44749BC5.6030807@e-tobi.net> Date: Wed, 24 May 2006 19:45:41 +0200 From: Tobias Grimm User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] Some small bug in vdr 1.4.0 References: <44709617.20804@e-tobi.net> <20060524064100.GA16969@gmail.com> <44749AFD.3070300@e-tobi.net> In-Reply-To: <44749AFD.3070300@e-tobi.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:3a660adf8439ddc7be7d699eb4083112 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 May 2006 17:45:44 -0000 Status: O X-Status: X-Keywords: X-UID: 9586 Tobias Grimm wrote: > I've attached the patch to this mail. Ooops... forgot that :-) To enable the patch, you must define VDRDEBUG. Tobias #! /bin/sh /usr/share/dpatch/dpatch-run ## 82_valgrind.dpatch by Debian VDR Team ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ diff -urNad vdr-1.3.49~/plugin.c vdr-1.3.49/plugin.c --- vdr-1.3.49~/plugin.c 2006-04-17 11:20:05.000000000 +0200 +++ vdr-1.3.49/plugin.c 2006-05-01 12:17:01.000000000 +0200 @@ -144,6 +144,10 @@ // --- cDll ------------------------------------------------------------------ +#ifdef VDRDEBUG +bool cDll::keepPlugins = false; +#endif + cDll::cDll(const char *FileName, const char *Args) { fileName = strdup(FileName); @@ -155,8 +159,16 @@ cDll::~cDll() { delete plugin; +#ifdef VDRDEBUG + if (!keepPlugins) + { + if (handle) + dlclose(handle); + } +#else if (handle) dlclose(handle); +#endif free(args); free(fileName); } diff -urNad vdr-1.3.49~/plugin.h vdr-1.3.49/plugin.h --- vdr-1.3.49~/plugin.h 2006-04-17 11:18:16.000000000 +0200 +++ vdr-1.3.49/plugin.h 2006-05-01 12:16:44.000000000 +0200 @@ -67,6 +67,9 @@ void *handle; cPlugin *plugin; public: + #ifdef VDRDEBUG + static bool keepPlugins; + #endif cDll(const char *FileName, const char *Args); virtual ~cDll(); bool Load(bool Log = false); diff -urNad vdr-1.3.49~/vdr.c vdr-1.3.49/vdr.c --- vdr-1.3.49~/vdr.c 2006-05-01 12:13:12.000000000 +0200 +++ vdr-1.3.49/vdr.c 2006-05-01 12:17:12.000000000 +0200 @@ -213,6 +213,9 @@ { "epgfile", required_argument, NULL, 'E' }, { "grab", required_argument, NULL, 'g' }, { "help", no_argument, NULL, 'h' }, +#ifdef VDRDEBUG + { "keep-plugins", no_argument, NULL, 'k' }, +#endif { "lib", required_argument, NULL, 'L' }, { "lirc", optional_argument, NULL, 'l' | 0x100 }, { "log", required_argument, NULL, 'l' }, @@ -233,7 +236,7 @@ }; int c; - while ((c = getopt_long(argc, argv, "a:c:dD:E:g:hl:L:mp:P:r:s:t:u:v:Vw:", long_options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "a:c:dD:E:g:hkl:L:mp:P:r:s:t:u:v:Vw:", long_options, NULL)) != -1) { switch (c) { case 'a': AudioCommand = optarg; break; @@ -256,6 +259,10 @@ break; case 'h': DisplayHelp = true; break; +#ifdef VDRDEBUG + case 'k': cDll::keepPlugins = true; + break; +#endif case 'l': { char *p = strchr(optarg, '.'); if (p) @@ -385,6 +392,9 @@ " existing directory, without any \"..\", double '/'\n" " or symlinks (default: none, same as -g-)\n" " -h, --help print this help and exit\n" +#ifdef VDRDEBUG + " -k --keep-plugins Support valgrind by not unloading plugins\n" +#endif " -l LEVEL, --log=LEVEL set log level (default: 3)\n" " 0 = no logging, 1 = errors only,\n" " 2 = errors and info, 3 = errors, info and debug\n"