Objects do not appear in the List and are not deleted!

 

Hello everyone. I have this problem on my mt5. I create the text objects and delete them whenever a different value is loaded, and create them again. However, sometimes the object is not deleted, so I change the time frame and everything goes back to normal. And the object that has not been deleted does not appear in the list of objects.


Below is an excerpt from the creation and update code. And the timer event that deletes it.

 if(!TextCreate(id_chart, id_vol, 0, time[pos] + 0, p_arr[pos] + 3.0 * _Point * pnt, total_str, "Tahoma", 7, Snow, 0, ANCHOR_LEFT, false, false, true, 0))
               return;
            else {
               TextChange(id_chart, id_vol, total_str);
               TextMove(id_chart, total_str, time[pos] + 0, p_arr[pos] +  3.0 * _Point * pnt);
            }
void OnTimer() {
   tmr += 1;
   if(tmr == 8) {
      for (int i = ObjectsTotal(id_chart, 0, OBJ_TEXT) - 1; i >= 0; i--) {
         string namet = ObjectName(id_chart, i, 0, OBJ_TEXT);
         pos_h_act = StringFind(namet, TimeToString(time_h_zz.At(act), TIME_DATE | TIME_MINUTES));
         pos_l_act = StringFind(namet, TimeToString(time_l_zz.At(act), TIME_DATE | TIME_MINUTES));
         if (pos_h_act > 0 || pos_l_act > 0)
            if(ObjectFind(id_chart, namet) == 0)
               TextDelete(id_chart, namet);
      }
   //}
   //if(tmr == 4) {
      if(!ChartSetSymbolPeriod(id_chart, _Symbol, PERIOD_CURRENT))
         PrintFormat("Falha ao atualizar gráfico para o símbolo %s/%s, código de erro %d", _Symbol, GetLastError());
      tmr = 0;
   }
}