Timer memory leak



  • For me, cli's a novel, but please explain, I have the simplest code in time:

    private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
        String^ tempString = textBox1->Text;
    }
    

    Why is there a leak in the 4xB\s, I don't understand the local object String?



  • It's a controlled code, he's gonna release memory not when you want it, but when the GC works.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2