From: Takashi Iwai Subject: Re: missing snd_dlclose in timer.c Date: Tue, 25 Apr 2006 15:27:48 +0200 Message-ID: References: <444DE5E0.9030200@purplelabs.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id 87E8915A for ; Tue, 25 Apr 2006 15:27:53 +0200 (MEST) In-Reply-To: <444DE5E0.9030200@purplelabs.com> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Benoit Fouet Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 25 Apr 2006 11:03:28 +0200, Benoit Fouet wrote: > > Hi, > > I worked on an ARM9E platform with not much memory. We had to > dynamically link the libraries we needed. > BTW I found out that there was a dlclose missing in ALSA lib in the > snd_timer_open_conf function. > Find below the diff of my file, if you want to add it in th hg repository. A good catch. I just wonder whether it's safe to call dlclose() there. Can the callback functions dynamically registered by open (e.g. snd_timer_hw_open) be still accessed safely after dlclose()? Or should we keep dl handle and dlclose it in snd_timer_close()? Takashi > > Cheers, > Ben > > > diff -r 211e55692b5d src/timer/timer.c > --- a/src/timer/timer.c Wed Apr 19 12:29:47 2006 +0200 > +++ b/src/timer/timer.c Tue Apr 25 10:53:04 2006 +0200 > @@ -171,7 +171,10 @@ static int snd_timer_open_conf(snd_timer > _err: > if (type_conf) > snd_config_delete(type_conf); > - return err >= 0 ? open_func(timer, name, timer_root, timer_conf, > mode) : err; > + err = err >= 0 ? open_func(timer, name, timer_root, timer_conf, > mode) : err; > + if (h) > + snd_dlclose(h); > + return err; > } > > static int snd_timer_open_noupdate(snd_timer_t **timer, snd_config_t > *root, const char *name, int mode) > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/alsa-devel > ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642