Dave,
I found a good explanation of disposables:
http://groups.google.com/group/closure-library-discuss/browse_thread/thread/b2b38d0045464439

Creighton Kirkendall

On Jan 16, 6:25 pm, Dave Sann <daves...@gmail.com> wrote:
> If you use something like goog.async.Delay, or other goog closure libs that
> produce objects that have a dispose method,
>
> Is it imperative that .dispose is called when you are done with this object?
> What happens if not? memory leak?
> How do you manage this if you are passing such objects around in function
> closures or other structures
> where you may not (want to) know exactly when this may be no longer
> required?
>
> I was looking at this thread - and the conversion of js/setTimeout to
> goog.async.Delay, along with the enfocus implementation
>
> https://groups.google.com/d/msg/clojure/epHVbmcNzgs/3pVyS_AKCYUJ
>
> from enfocus:
>
> (defn setTimeout [func ttime]
>   (. (new goog.async.Delay func ttime) (start)))
>
> what about functions such as this?
>
> (defn repeat-with-timeout
>   [f t]
>   (let [stop (f)]
>     (if-not (= true stop)
>       (js/setTimeout #(repeat-with-timeout f t) t))))
>
> Cheers
>
> Dave

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to