🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #37130

destroyCallback under R4 Athena Widgets

#37130
From: Frank Goodman
Date: Wed, 21 Feb 1990 19:50
67 lines
2248 bytes
It's me again...

I'm still working on implementing a widget of my own design under athena.

My Widget has a bunch of stuff that needs to be released/freed before it dies, 
including the removal of a tmp file.

In my widget's .c file is as follows:

.
.
.
static void Destroy();
.
.
.


MyWidgetClassRec myWidgetClassRec = {
.
.
.
/* visible_interest         */      FALSE,
/* destroy                  */      Destroy,
.
.
.
}

static void Destroy(w, call, client)
   {
   printf(I'm in Destroy...\n);
   fflush(stdout);
   /*
    * free my widget stuff
    * remove temp file
    */
   }


My Application Exit function looks like this:

void Exit(status)
    int status;
    {
    XtUnmapWidget(top);
    XtDestroyApplicationContext(XtWidgetToApplicationContext(top));
    exit(status);
    }

However,
   My widget's destroy function is never getting called. Am I missing something
   here? I've tried explicitly calling XtDestroyWidget(myWidget), before
   the XtDestroyAppl call in Exit, and I've also tried not defining the
   Destroy callback in the WidgetRec, but using XtAddCallback in the
   Initializes routine of my widget. None of these work? What am I doing
   wrong?

Considering all the discussion about memeory leaks, this seems pretty
important.

---------------------------------------------------------------------------
Frank  Goodman				arpa:  spanki@CED.Berkeley.EDU
University of California, Berkeley	  or:  spanki%CED@jade.Berkeley.EDU
College of Environmental Design		uucp:  ...hplabs!ucbvax!ced!spanki 
S.I.S Research Laboratory	 	phone: Novelty item, not necessary
---------------------------------------------------------------------------
Technical Details
Message-ID: <1990Feb21.195029.27391@agate.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!agate!color.ced.berkeley.edu!spanki

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!agate!color.ced.berkeley.edu!spanki
From: spanki@color.ced.berkeley.edu (Frank Goodman)
Newsgroups: comp.windows.x
Subject: destroyCallback under R4 Athena Widgets
Message-ID: <1990Feb21.195029.27391@agate.berkeley.edu>
Date: 21 Feb 90 19:50:29 GMT
Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44)
Reply-To: spanki@color.ced.berkeley.edu (Frank Goodman)
Organization: UC Berkeley Center of Environmental Design Research
Lines: 67