Re: [Ralf Engels] zinf musicbrowser.cpp

Kristian Kvilekval <[email protected]>
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <1058661340.536.54.camel@krispc>
Look fine to me too.. commit it.



On Sat, 2003-07-19 at 11:01, Andreas Rottmann wrote:
> This looks reasonable to me. Thoughts?
> 
> 
> ______________________________________________________________________
> From: Ralf Engels <[email protected]>
> To: Andreas Rottmann <[email protected]>
> Subject: zinf musicbrowser.cpp
> Date: 18 Jul 2003 22:39:10 +0200
> 
>     Hi,
> I compiled the CVS version from 17-July and got a segmentation fault 
> which could be tracked to musicbrowser.cpp
> 
> When I started zinf I got the message:
> "Parsing the Theme description failed: ..."
> The error is probably connected to my old freeamp installation.
> 
> However afterwards I got the segmentation fault in 
> MuiscBrowserUI::AcceptEvents on the line
> delete mainBrowser
> 
> I am not sure what exactly the error was because the stack got corrupted.
> However the attached patch solves the issue.
> 
> 
> Could you please check my correction and check the changes in.
> 
> Thanks,
> Ralf
> 
> ______________________________________________________________________
> --- musicbrowser.cpp.old	2003-07-18 22:22:14.000000000 +0200
> +++ musicbrowser.cpp	2003-07-18 22:27:42.000000000 +0200
> @@ -45,13 +45,23 @@
>  
>  MusicBrowserUI::MusicBrowserUI(FAContext *context)
>  {
> +    // important, initialize all class variables every time!
> +    // m_playerEQ
>      m_context = context;
> -    searching = NULL;
> +    isVisible = false;
> +    m_propManager = NULL;
> +    m_startupType = 0;
> +    m_initialized = false;
> +    mainBrowser = NULL;
> +    // browserWindows
>      wiz = NULL;
> +    searching = NULL;
>  }
>  
>  MusicBrowserUI::~MusicBrowserUI()
>  {
> +  if( mainBrowser )
> +    delete mainBrowser;
>  }
>  
>  Error MusicBrowserUI::Init(int32_t startup_level) 
> @@ -80,7 +90,6 @@
>      switch (event->Type()) {
>          case CMD_Cleanup: {
>              mainBrowser->Close(false);
> -            delete mainBrowser;
>  
>              while (browserWindows.size() > 0) {
>                  browserWindows[0]->Close(false);
> 
> ______________________________________________________________________
> Regards, Andy
-- 
Kristian G. Kvilekval
email:[email protected] office:(805)893-4276 http://www.cs.ucsb.edu/~kris



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.