fix leaked exit Actor

This commit is contained in:
Chris Danford
2006-01-26 00:00:41 +00:00
parent c82073a40c
commit c88058395a
2 changed files with 6 additions and 7 deletions
+5 -5
View File
@@ -126,11 +126,11 @@ void ScreenMapControllers::Init()
// exit row // exit row
{ {
m_pExit = ActorUtil::MakeActor( THEME->GetPathG(m_sName,"exit") ); m_sprExit.Load( THEME->GetPathG(m_sName,"exit") );
m_pExit->SetName( "Exit" ); m_sprExit->SetName( "Exit" );
ActorUtil::LoadAllCommands( *m_pExit, m_sName ); ActorUtil::LoadAllCommands( *m_sprExit, m_sName );
m_Line[iRow].AddChild( m_pExit ); m_Line[iRow].AddChild( m_sprExit );
m_LineScroller.AddChild( &m_Line[iRow] ); m_LineScroller.AddChild( &m_Line[iRow] );
iRow++; iRow++;
@@ -408,7 +408,7 @@ void ScreenMapControllers::TweenOffScreen()
Actor *ScreenMapControllers::GetActorWithFocus() Actor *ScreenMapControllers::GetActorWithFocus()
{ {
if( m_iCurButton == (int) m_KeysToMap.size() ) if( m_iCurButton == (int) m_KeysToMap.size() )
return m_pExit; return m_sprExit;
const KeyToMap *pKey = &m_KeysToMap[m_iCurButton]; const KeyToMap *pKey = &m_KeysToMap[m_iCurButton];
return pKey->m_textMappedTo[m_iCurController][m_iCurSlot]; return pKey->m_textMappedTo[m_iCurController][m_iCurSlot];
+1 -2
View File
@@ -47,8 +47,7 @@ private:
BitmapText m_textLabel[MAX_GAME_CONTROLLERS]; BitmapText m_textLabel[MAX_GAME_CONTROLLERS];
// owned by m_Line AutoActor m_sprExit;
Actor *m_pExit;
ActorFrame m_Line[MAX_GAME_BUTTONS+2]; // label, normal lines, exit ActorFrame m_Line[MAX_GAME_BUTTONS+2]; // label, normal lines, exit
ActorScroller m_LineScroller; ActorScroller m_LineScroller;