Skip to content
Snippets Groups Projects
Commit eb37438e authored by slevy's avatar slevy
Browse files

Need to resize() when adding new elements, not just reserve().

parent a2f169b1
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,9 @@ static char local_id[] = "$Id$";
/*
* $Log$
* Revision 1.7 2008/07/22 23:20:07 slevy
* Need to resize() when adding new elements, not just reserve().
*
* Revision 1.6 2008/07/22 18:46:14 slevy
* Use ar_log_<whatever>() for msg() logging. Send to either _remark or _warning
* according to whether msg() or warn() was called.
......@@ -291,6 +294,8 @@ PvObject *PvScene::addobj( const char *objname, int id ) {
if(objstuff(id) == 0) {
if(id >= objs_.capacity())
objs_.reserve( id + 15 );
if(id >= objs_.size())
objs_.resize( id+1 );
objs_[id].init( objname, id );
} else {
msg("Warning: Reusing object g%d (named %s)", id, objname);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment