From 93e6a59c9a3abcedcf34cae513420f96b2d7cd71 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 11 Mar 2013 17:16:32 +0000 Subject: [PATCH] From Aurelien Albert, "There is a little bug in the osg::Group::insertChild method : If the index is more than the size of _children vector, the new child is pushed at the end of the vector, but the index value is unmodified, so an incorrect value is passed to the "childInserted" method." --- src/osg/Group.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osg/Group.cpp b/src/osg/Group.cpp index 36606dda1..0bc91bd2b 100644 --- a/src/osg/Group.cpp +++ b/src/osg/Group.cpp @@ -86,6 +86,7 @@ bool Group::insertChild( unsigned int index, Node *child ) // note ref_ptr<> automatically handles incrementing child's reference count. if (index >= _children.size()) { + index = _children.size(); // set correct index value to be passed to the "childInserted" method _children.push_back(child); } else