On Wednesday 29 of February 2012, Caolán McNamara wrote:
But ok, it's too much to just abort in every case. I think however that
whether to abort or try to recover does not actually depend on the class
where the problem occurs, but on where the class is used. I.e. I expect
nobody will bother (=it's not worthwhile to do) to check for pixmap
allocation failures and handle them somewhere in drawing code, but may check
for them in an import filter. And even in the import filter, I think the only
good reaction is bailing out completely and returning an error, not ignoring
it silently like in the case I pointed out earlier. So we can split our
source in two areas:
- the default, where we don't bother checking and just abort, because it's not
worthwhile to make the effort
- special areas, where we expect allocation failures to be more likely (import
filters, expensive operations in Calc, whatever), there we try to recover
Which brings me to the following idea: We make rtl_allocateMemory() just
abort by default. Those special areas get surrounded by setting a flag that
will change that to throwing an exception, and each of such areas will be
also inside a try/catch block that'll catch the exception and propagate
failure of that code in a suitable way.
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.