Comment 45 for bug 732572

Revision history for this message
In , Karlt (karlt) wrote :

Comment on attachment 575899
Bug 635918 Part 1 - Make nsISound::Play use libcanberra on Linux rather than esound (v3)

I didn't know the nsLocalFile implementation was thread safe, but yay it is:
http://mxr.mozilla.org/mozilla-central/source/xpcom/io/nsLocalFileUnix.cpp#287

>+ nsILocalFile* forget() {
>+ nsILocalFile *tmp;
>+ mFile.forget(&tmp);
>+ return tmp;
>+ }

Usually we have already_AddRefed<T> return values for forget() methods in
scoped refcounting systems so this is a bit different if the result is ever
assigned to another similar auto-refcount object. The return value is in fact
not used, so use "mFile.forget()" to simplify things and either return its
result directly or make the function return type void.

>+ operator void*() { return mFile; }

Making this "operator nsILocalFile*()" would be more explicit.