Hi every body

Dieter Landolt dieter.landolt at secs.ch
Tue Jul 2 21:40:52 UTC 2002


Hi,

I think you forgot to allocate the memory for your tmp_queue.
The second thing is you take CColaMensajes for the
Object Type CSavdeamon class.
My opinion is thet will never work.
First try the same Classes for initialisation,
second allocate the memory, eventuali with the ne statement.

Dear Dieter

On Tuesday 02 July 2002 16:01, you wrote:
> Hi, first of all, forgive my english...
>
> I'm developing a daemon application, as usual this app is killed by signals
> I'm trying with signal 15 this is my code:
>
> void kill_all(){
>      CColaMensajes * tmp_queue = sav->Cola();
>      tmp_queue->borrarcola();
>      delete sav;
> }
>
> void terminar (int signal){
>      kill_all();
>      _exit(0);
> }
>
>
> int main(int argc, char *argv[]){
>      signal(15, terminar);
>      sav = new CSavdaemon();
>      kill_all();
>
>      return EXIT_SUCCESS;
> }
>
> CColaMensjes is a class to work with IPC V Messages queues, CSavdaemon sav
> has a memember of type CColaMensajes * and sav->Cola() return CColaMensajes
> *. When debuggin (without signals)every goes fine, but at run time I get a
> Segmentation fault in the line:
>
> CColaMensajes * tmp_queue = sav->Cola();
>
> Note that it work fine when debbuging.
>
> I'll appreciate any help!!!
>
> -
> to unsubscribe from this list send an email to
> kdevelop-request at kdevelop.org with the following body: unsubscribe
> »your-email-address«


-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list