> > However I'd like to know why you want to know it ? 
> I want to know that _before_ calling ggiExtensionDetach(), because
> ggi{GA|Ovl|Blt}Detach() want to free private structure in the last
> instance, which are stored in the visual. 

Oh - I see. The simple workaround is to simply cache the pointer to said
structure and then free it. Like this:

int ggiWhateverDetach(ggi_visual_t vis)
{
        int rc;
        whateverext *we = LIBGGI_WHATEVEREXT(vis);
        void *mypriv    = we->mypriv;   /* pointer still valid. Cache it. */

        rc = ggiExtensionDetach(vis,ggiWhateverID);
        GGIDPRINT("Detached Whatever extension from %p. rc=%i\n", vis, rc);
        if (rc==0) free(mypriv);
        return rc;                                                              
}

Solves it ?

> And when I call ggiExtensionDetach() before, then a segfault occures.
> Maybe ggiExtensionDetach() frees the priv, but it can't free a dynamic
> list at all...

No, it frees the extension struct - nothing more. Other stuff is up to the
extension itself.

CU, Andy

-- 
= Andreas Beck                    |  Email :  <[EMAIL PROTECTED]>        =

Reply via email to