Merge pull request #314 from LaurensVoerman/notify2

reduce the need to reallocate the std::ostream buffer behind osg::Notify
This commit is contained in:
OpenSceneGraph git repository
2017-08-23 14:48:04 +01:00
committed by GitHub

View File

@@ -61,6 +61,9 @@ struct NotifyStreamBuffer : public std::stringbuf
{
NotifyStreamBuffer() : _severity(osg::NOTICE)
{
/* reduce the need to reallocate the std::ostream buffer behind osg::Notify (causing multitreading issues) by pre-allocating 4095 bytes */
str(std::string(4095, 0));
pubseekpos(0, std::ios_base::out);
}
void setNotifyHandler(osg::NotifyHandler *handler) { _handler = handler; }