Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

app.cpp

<< < (3/3)

Urxae:

--- Quote from: thomas on January 25, 2006, 12:30:28 am ---
--- Quote from: Urxae on January 25, 2006, 12:03:32 am ---1) Especially with the annoying new wxCriticalSectionLocker removal you seem to have thrown in; what's the point of wxCriticalSectionLocker if you're going to dynamically allocate it? :shock:
--- End quote ---
[...]
My point with an automatic critical section locker inside a curly brace block is that it is about 200 times faster than dynamically allocating and manually freeing it, and it is exception-safe too, which is the main reason why you use a locker object in the first place. :)

--- End quote ---

You realize that was a rhetorical question, right?

EDIT: Oh, and in addition to the reasons you gave, you can always call wxCriticalSection::Enter() and wxCriticalSection::Leave() instead of dynamically creating and destroying a locker, for the exact same effect but without the dynamic allocation overhead. (So still not exception-safe, but at least as fast as a non-dynamically allocated locker)
(Therefore there is absolutely no reason to ever use new wxCriticalSectionLocker. There is always a better way)

Navigation

[0] Message Index

[*] Previous page

Go to full version