Index:
[thread]
[date]
[subject]
[author]
From: Kien Pham <xengren@yahoo.com>
To : ggi-develop@eskimo.com
Date: Fri, 16 Jul 1999 11:28:50 -0400 (EDT)
Extensions
O.K. I have clarity now.
My exact question is what exactly is the point of
allowing extensions to Attach() to visuals multiple times
when all this does is increment a counter. I've looked at
the code and I know what the code does. My question
really boils down to why it was implemented in that
fashion.
In what circumstances would this be useful?
An alternate and simplier implementation that seems obvious
to me would be to have an isAttached() function so that
an extension would only have to call Attach() once.
Since this is very obvious, the authors must have a concise
and valid reason for choosing to implement it the way they
did. I just cannot figure out why.
This is relevent because my extension needs to initialize
data the first time it is Attach()ed to a visual. Succesive
calls to my function will cause it to check the return
value of Attach()ed to see if the data is already
initialized. After this, I have two options. One is to
immediately Detach() if the return value is greater than 1
and the other is to "unwind" all Detach()es at the end of
the program. I find this a bit cumbersome. If I don't
properly Detach(), the data will never be free()ed.
Checking the results of LIBGGI_EXT against NULL is
obviously useless. I can't be assured that a visual has an
attachment.
~K.P.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Index:
[thread]
[date]
[subject]
[author]