EventListener "priv" field
Luca Padovani <[email protected]> Tue, 18 Feb 2003 18:54:19 +0100 (CET)
| Newsgroups | gmane.comp.gnome.gdome |
|---|---|
| Message-ID | <[email protected]> |
Dear Gdome2 users, Paolo in particular, after some struggling with the Ocaml binding for Gdome2 we realized that not only the "deprecated" field priv in an EventListener is necessary, but also that it is not enough in general. There are cases in which the pointer you store in "priv" is another reference counted object. Now, whenever the EventListener is destroyed, you can't simply forget about "priv", you also need to unref it. One possible way to do this would be to allow not only storing the "priv" field, but also a callback function that would be called just before the EventListener is destroyed when its ref counter reaches 0. DOM level 3 basically adds this functionality in a more general way, but I believe it is not our intention to move to level 3 in the short term, so we were wondering if the simple callback solution would meet your consensus or not. We also understand that this would not be compliant to the standard, but as an extension it doesn't affect anything else in the API. Concretely, the proposal is to have a separate constructor method for EventListener that takes both the priv field and also the callback function, which would make the API backward compatible. In case nobody objects, I volunteer for doing the required modfications (very few actually). -- luca