Note that there are some explanatory texts on larger screens.

plurals
  1. POWill GC collect an object with function pointers?
    primarykey
    data
    text
    <p>just a quick question. First of all, let me verify that I have the correct meaning of a function pointer. In the case of C#, a function pointer is basically just an event function am i right?</p> <p>second, consider the following snippet:</p> <pre><code>public FormAnimator(Form form) { this.m_Form = form; this.m_Form.Load += new EventHandler(m_Form_Load); this.m_Form.VisibleChanged += new EventHandler(m_Form_VisibleChanged); this.m_Form.Closing += new CancelEventHandler(m_Form_Closing); } </code></pre> <p>where m_Form is a private variable of type</p> <pre><code> //The form to be animated. private Form m_Form; </code></pre> <p>Heres how the class is instantiated:</p> <pre><code>public partial class toastform : Form { public toastform(skImage ic) : this() { //Attach this form to the Formanimator. //The FormAnimator now has a reference to this toastform. //When the load() of this form is invoked, the Form animator intercepts it and displays the form. this.m_Animator = new FormAnimator(this, FormAnimator.AnimationMethod.Slide, FormAnimator.AnimationDirection.Up, 400); } </code></pre> <p>so when i create a new toastform (with the something = new toastform();) and call the Show() the show method SHOULD be the one from the form animator. Now, when the toastform closes, how do I make sure the FormAnimator object is also destoryed.. if someone can please explain the full story of what is happening, i'd appreciate that. what i mean is that .. do the toastform class, and the formanimator class both point to the same object, is my lingo right when i say form animator "intercepts" the taostform's events and so on..</p> <p>thanks</p> <p>tldr: I just need to know if I need to manually remove handlers for the events in Formanimator class.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload