HtmlEditor :  Phorum 5 The fastest message board... ever.

This is the discussion forum for the HtmlEditor. See also the HtmlEditor home page, where you can download the control, and the Documentation Wiki, a collaborative project for documenting the control.

Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
Invalid cast exception in Dispose
Posted by: Nathan Allan (67.214.229.---)
Date: Monday, 23-Jun-2008, 18:05:33

I suggest the following lines be removed from HtmlEditor.Dispose:

layer to release the object.
IntPtr ptr = Marshal.GetIDispatchForObject(this);
int i = Marshal.Release(ptr);
while (i > 0)
i = Marshal.Release(ptr);

I'm not exactly sure what about my case is unique, but on the call to GetIDispatch... I get an invalid cast exception. I think this may be due to the fact that my form is already hidden at this point. I don't know of any way to make this "safe" besides putting an exception block around it, and I beleive that the marshalling layer will properly release the IDispatch, so should the lines simply be removed?

Re: Invalid cast exception in Dispose
Posted by: Tim (Moderator)
Date: Friday, 04-Jul-2008, 14:52:12


Well, the reason for this is that I made intensive efforts to avoid memory leaks.

Have you tried it using something like memprofiler?



Your Name: 
Your Email: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically.
This is a moderated forum. Your message will remain hidden until it has been approved by a moderator or administrator
This forum powered by Phorum.