wxWidgets and memory allocation failures.
Jurko Gospodnetić
jurko_for_boost at mail.inet.hr
Wed Apr 11 03:45:38 PDT 2007
But.
> As I said, nothing in wxWidgets handling of memory management conditions
> is right. Now there are many things which could be done about it but
> putting comments saying that just about any wx function can throw a
> bad_alloc hardly seems like the most useful thing to do -- just how exactly
> will it help anybody in practice?
Well, the documentation should at least state this instead of saying
that no wxWidgets function may throw exceptions.
In our applications we regularly use exceptions and document them for
every function so documenting the std::bad_alloc for us comes as a
completely insignificant overhead. On the other hand its great when our
libraries have precise exceptions specifications available for the
users, or when we need to convert exceptions to error codes at DLL
boundaries.
> Unfortunately to really solve this problem would require more time (and,
> to be honest, motivation) than I currently have. If somebody can suggest
> or, better, implement a fix for this -- good. If not, let's just continue
> to suppose that wxWidgets programs never run out of memory. And, honestly,
> this is not such a stupid assumption to make nowadays.
Hmmm, could it at least be documented how this should be solved,
placed on the todo list as a low-priority item and then have the code
morphed slowly over time?
Best regards,
Jurko Gospodnetić
More information about the wx-users
mailing list