Re: Just another SEGV ...

From: Volker Hejny (V.Hejny@fz-juelich.de)
Date: Wed Aug 18 1999 - 09:11:21 MEST


Hi,

thanks for your guide how to manage these problems. In some way
this is exactly what I'm doing now and as long as I'm only
dealing with pointers and new/delete, it works.

On Tue, Aug 17, 1999 at 09:15:45PM +0900, Masaharu Goto wrote:
> 
> I suspect both problems have the same root cause. I haven't been able
> to look into the detail, it is likely that combination of compiled class
> and interpreted class has something to do.  Can you avoid following cases?
> 
>    // Interpreted class inherits from Compiled class
>    class Interpreted : public Compiled {
>    };

This is difficult to avoid, C++ without inherited classes? But,
nevertheless, this also works if later on instances of the 
interpreted class are only referenced by pointers, like in your
next example below:

>    class Compile;
>    class Interpreted {
>      Compiled *p;
>     public:
>      Interpreted() { p = new Compiled; }
>      ~Interpreted() { delete p; }
>    };
> 
> Could you implement EMModule in this way?

I've implemented the classes which use EMModule in this way
(i.e. Compiled <-> EMModule) and this seem to work now.

Best regards,
Volker

-- 
Volker Hejny                    Tel: 02461/616853                      ** 
Institut f. Kernphysik          Fax: 02461/613930                     **
---------------------------------------------------------------- **  ** ---  
Forschungszentrum Juelich GmbH, D-52425 Juelich                    **



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:38 MET