title: TimerHandler duplicating and cannot be unregistered in andengine
body: <p>I need some help with a strange problem I am having involving TimerHandlers. For some reason when I call unregisterUpdateHandler on my set of timers they don't get removed on the first pass. This problem has been driving me nuts since it makes absolutely no sense to me. I only add the timers once and unregistered them when restarting my level. If I don't register a new set of timers the old ones persist as if I never unregistered them and they stay until I restart the level again then they're finally gone. Has anyone else ever encountered this problem?</p>
  
  <p>These are all part of the same class</p>
  
  <pre><code>@Override
  public void createScene() {
  
      createBackground();
      createHUD();
      createPhysics();
  
      if(!firstTry)
      {
          createSprites();
          firstTry = true;
  
      }
      loadLevel(1);
      createGameOverText();
      loadData();
      //levelCompleteWindow = new LevelCompleteWindow(vbom);
  
      setOnSceneTouchListener(this);
  
  }
  
  public void createSprites()
  {
      updater =  new TimerHandler(1f, new ITimerCallback() 
      {
          public void onTimePassed(final TimerHandler pTimerHandler) 
          {
  
              updateTime();
              /*if(timeRemaining &lt;=0)
              {
                  player.onDie();
              }*/
              pTimerHandler.reset();
          }
      });
      itemMaker = new TimerHandler(5f, new ITimerCallback() 
      {
          public void onTimePassed(final TimerHandler pTimerHandler) 
          {
              createItem();
              pTimerHandler.reset();
          }
      });
      enemyMaker = new TimerHandler(2.5f, new ITimerCallback() 
      {
          public void onTimePassed(final TimerHandler pTimerHandler) 
          {
              createEnemy();
              pTimerHandler.reset();
          }
      });
  
      player = new Player(SCREEN_WIDTH/10,SCREEN_HEIGHT-ResourceManager.getInstance().player_region.getHeight(), vbom, camera, physicsWorld)
      {
  
          @Override
          public void onDie() {
              // TODO Auto-generated method stub
              if (!gameOverDisplayed)
              {
                  displayGameOverText();
                  saveData();
                  createMenuChildScene();
                  //Log.d("TEST","CALLED");
                  physicsWorld.unregisterPhysicsConnector(this.fall);
                  //unregisterUpdateHandler(updater);
                  //unregisterUpdateHandler(itemMaker);
                  //unregisterUpdateHandler(enemyMaker);
                  //unregisterUpdateHandler(increase);
              }
          }
  
      };
      this.registerUpdateHandler(updater);
      this.registerUpdateHandler(itemMaker);
      this.registerUpdateHandler(enemyMaker);
      //this.registerUpdateHandler(increase);
  }
  </code></pre>
  
  <p>This is called when the player dies to restart the scene without reloading the class</p>
  
  <pre><code>private void cleanUp()
  {
      this.detachChildren();
      menuChildScene.back();
  
      timeRemaining = 30;
      totalTime = 0;
      isRunning=false;
      gameOverDisplayed = false;
      //Log.d("TEST","PLayer Y:"+ player.getY());
      //player.setY(SCREEN_HEIGHT-ResourceManager.getInstance().player_region.getHeight());
      //player.
      //updater.reset();
      //itemMaker.reset();
      //enemyMaker.reset();
      //increase.reset();
      this.unregisterUpdateHandler(updater);
      this.unregisterUpdateHandler(itemMaker);
      this.unregisterUpdateHandler(enemyMaker);
      //this.unregisterUpdateHandler(increase);
      Log.d("TEST","Handlers Unregistered");
      //physicsWorld.registerPhysicsConnector(player.fall);
      player = new Player(SCREEN_WIDTH/10,SCREEN_HEIGHT-ResourceManager.getInstance().player_region.getHeight(), vbom, camera, physicsWorld)
      {
  
          @Override
          public void onDie() {
              // TODO Auto-generated method stub
              if (!gameOverDisplayed)
              {
                  displayGameOverText();
                  saveData();
                  createMenuChildScene();
                  //Log.d("TEST","CALLED");
                  physicsWorld.unregisterPhysicsConnector(this.fall);
                  //unregisterUpdateHandler(updater);
                  //unregisterUpdateHandler(itemMaker);
                  //unregisterUpdateHandler(enemyMaker);
                  //unregisterUpdateHandler(increase);
              }
          }
  
      };
      //this.unregisterUpdateHandlers(pUpdateHandlerMatcher);
  }
  </code></pre>
  
  <p>I'll add more code if needed but these are the only instances where TimerHandlers are referenced. As you can see, I tried to unregister the timers multiple times before but the results were the same with the timers not being removed until the second pass/death</p>
  
  <p>EDIT: Here is the whole class (Kinda messy and a bit hard to read)
  <a href="https://gist.github.com/powerbot99/6030edb3e4c1e84a6200" rel="nofollow">https://gist.github.com/powerbot99/6030edb3e4c1e84a6200</a></p>