When must I set a variable to “Nothing” in VB6?

后端 未结 8 3468
刺人心
刺人心 2021-02-20 19:00

In one of my VB6 forms, I create several other Form objects and store them in member variables.

Private m_frm1 as MyForm
Private m_frm2 as MyForm

// Later...
Se         


        
8条回答
  •  情书的邮戳
    2021-02-20 19:22

    Strictly speaking never, but it gives the garbage collector a strong hint to clean things up.

    As a rule: do it every time you're done with an object that you've created.

提交回复
热议问题