Quote Originally Posted by Bubba View Post
This is very strange but the program is crashing on array access to the SmartVector. But it only happens every so often so this is going to be a fun bug to track down.

It bails on:

SmartVector.h - SmartVector:: operator []
Code:
  
    T &operator[] (const size_t &index)
    {
        return m_vVector[index];
    }
If you use m_vVector.at( index ); instead of [index] then the vector should throw an out_of_bounds exception instead of just crashing.

Quote Originally Posted by Bubba View Post
SpriteMgr.cpp - SpriteMgr::Remove()
Code:
bool SpriteMgr::Remove(const size_t &index)
{
    //De-allocate memory
    delete m_vSprites[index];

    //Remove from vector (only nullifies, does not actually remove)
    return m_vSprites.Remove(index);
}
SmartVector.h - SmartVector::Remove()
Code:
    virtual bool Remove(const size_t &index)
    {
        //Check for out of range
        if (index > (m_vVector.size()-1))
        {
            return false;
        }
        
        //Nullify current 'slot'
        m_vVector[index] = NULL;

        //Set cache index to this index (this will be used on next Add() operation)
        m_CacheIndex = index;

        //Cache value is now valid
        m_CacheValid = true;
        return true;
                
    }
Shouldn't you check if the index is valid (i.e. in range) before deleting it?