Missing ReleaseComObject in BeforeItemPaste

Add-in Express™ Support Service
That's what is more important than anything else

Missing ReleaseComObject in BeforeItemPaste
 
Christian Kiewiet




Posts: 8
Joined: 2015-01-26
Hi,

in ADXAddInModule.cs line #13661:


void AddinExpress.MSO.IExplorerEvents_10.BeforeItemPaste(object clipboardContent, object folder, ref bool cancel)
{
if (events != null) events.DoExplorerBeforeItemPaste(clipboardContent, folder, ref cancel);
}


Why are "folder" and "clipboardContent" not being released using Globals.ReleaseComObject();?

Best,
Christian
"Time flies like an arrow; fruit flies like a banana"
Posted 19 Feb, 2015 06:09:23 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Christian,

This is a bug which is now filed under #6388 in our bug-tracking db. When it is fixed, you'll find this number in whatsnew.txt.

You can bypass it using this code:

private void adxOutlookEvents_ExplorerBeforeItemPaste(object sender, ADXOlExplorerBeforeItemPasteEventArgs e) {
    object clipboardContent = e.ClipboardContent;
    object folder = e.Folder;
    // handle the event here
    if (clipboardContent != null && Marshal.IsComObject(clipboardContent)) {
        Marshal.ReleaseComObject(clipboardContent); clipboardContent = null;
    }
    if (folder != null && Marshal.IsComObject(folder)) {
        
        Marshal.ReleaseComObject(folder); folder = null;
    }
}



Andrei Smolin
Add-in Express Team Leader
Posted 19 Feb, 2015 10:15:49 Top
Christian Kiewiet




Posts: 8
Joined: 2015-01-26
Hi Andrei,

thanks for the quick response. Won't the code situated in ComponentOL/Events.cs:


        void IExplorerEvents_10.BeforeItemPaste(object clipboardContent, object folder, ref bool cancel)
        {
            using (new LogEvent("IExplorerEvents_10.BeforeItemPaste"))
            {
            }
        }


Be affected by this as well? Is this code ever invoked? I am not sure.

Best,
Christian
"Time flies like an arrow; fruit flies like a banana"
Posted 19 Feb, 2015 10:23:04 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Christian,

This is a mistake. It is filed down under #6392. These must be released as well. Even if that event handler does nothing useful.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Feb, 2015 09:24:23 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Christian,

We've published a new Add-in Express build that fixes these issues, see https://www.add-in-express.com/downloads/adxnet.php.


Andrei Smolin
Add-in Express Team Leader
Posted 03 Apr, 2015 03:40:20 Top