Ignore:
Timestamp:
Aug 2, 2013, 5:50:33 PM (7 years ago)
Author:
sam
Message:

input: fix a memory leak in the controller code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/input/controller.cpp

    r2818 r2836  
    6969{
    7070    m_gamegroup = GAMEGROUP_BEFORE;
    71     m_nb_keys = nb_keys;
    72     m_nb_axis = nb_axis;
    73     m_keys = new KeyBinding[m_nb_keys];
    74     m_axis = new AxisBinding[m_nb_axis];
     71    m_keys.Resize(nb_keys);
     72    m_axis.Resize(nb_axis);
    7573    m_activate_nextframe = false;
    7674    m_deactivate_nextframe = false;
     
    9593    Entity::TickGame(seconds);
    9694
    97     for (int i = 0; i < m_nb_keys; ++i)
    98     {
     95    for (int i = 0; i < m_keys.Count(); ++i)
    9996        m_keys[i].Update();
    100     }
    10197
    102     for (int i = 0; i < m_nb_axis; ++i)
    103     {
     98    for (int i = 0; i < m_axis.Count(); ++i)
    10499        m_axis[i].Update();
    105     }
    106100
    107101    if (m_activate_nextframe)
Note: See TracChangeset for help on using the changeset viewer.