HI Lilin,

On 9 April 2013 04:07, Lilinx <[email protected]> wrote:
>   when isACString==false , writing wstring to ive file,
> the Writed UIntArray size is wrong.
>
>  I change line (in ive plugin text.cpp line 132)

Thanks the fix.  I've just done a review of your change against
svn/trunk and it looks to be like the original code intended the
texstring.size() to be used to reserve space rather than allocate to
the size provided.  I've replaced the constructor initialization with:

$ svn diff
Index: src/osgPlugins/ive/Text.cpp
===================================================================
--- src/osgPlugins/ive/Text.cpp (revision 13449)
+++ src/osgPlugins/ive/Text.cpp (working copy)
@@ -129,7 +129,8 @@
     else
     {
         // do it the hardway...output each character as an int
-        osg::ref_ptr<osg::UIntArray> strarr = new
osg::UIntArray(textstring.size());
+        osg::ref_ptr<osg::UIntArray> strarr = new osg::UIntArray();
+        strarr->reserve(textstring.size());

         for(itr=textstring.begin();
             itr!=textstring.end();

Could you check out svn/trunk and let me know if this fix works fine for you.

Cheers,
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to