GalleryEmbed::init / ::done

valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-05-15 16:22

A recent irc discussion yielded that there are different interpretations about how GalleryEmbed::init / ::done should be used.

As even I didn't use it like bharat thought it should be used, I reviewed a few things in the code.

GalleryEmbed::init() should be called only once per request.
GalleryEmbed::done() can be called multiple times.

We advice the use of a static variable to keep track in your integration code if you've already called GalleryEmbed::init().

I'd say we could move this static variable into GalleryEmbed::init(). That way, the integration code authors wouldn't have to care about it.

And because GalleryEmbed::init() can also GalleryInitSecondPass(), we should have two static variables. The second is to keep track if InitSecondPass() has been called.

Opinions?

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sun, 2005-05-15 21:30

Excellent idea that way G2 can check and make sure it is not breaking the rules, just in case us authors are ;)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-05-21 19:11

in cvs now.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Mon, 2005-05-23 11:31

:)