Hi Stephan, Stephan Bergmann píše v St 22. 01. 2014 v 10:22 +0100:
> I think there is better > solutions for that, like providing a helper function to be called from > the typical constructor function, > > css::uno::XInterface * acquire(cppu::OWeakObject * instance) { > assert(instance != 0); > instance->acquire(); > return instance; > } > > css::uno::XInterface * FOO_constructor_function(...) { > retrun acquire(new FOO(...)); > } Thank you for reviewing! :-) My problem with directly providing arguments to the _constructor_function (and consequently to the C++ constructor) was that it was hard to distinguish whether the code constructing the instance needs to work on an acquired interface, or not, so thought that if we 'force' every initialization to work on the acquired one, it leads to least trouble. But if this is not a problem, and the implementer should be aware & make the right choice, I am most happy; actually the resulting constructors look really beautiful from my POV: https://gerrit.libreoffice.org/7592 Thanks so much for this suggestion - if you are happy with the patch, I'd push it ASAP to unbreak the Windows build... All the best, Kendy _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice