Outlook Hard crashes

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

Outlook Hard crashes
Verify Specific scenario, and I think it's partially add-in express regions 
Josh Norris


Guest


One of my users is using MS Access to send send data (excel) from queries using: "External Data > Export (section) > Email". What this does is it creates a new email and attaches an excel file to that message.

If the user does this 3 times, as my custom form regions appear to be loading on this third time, outlook will hard crash. I can reproduce the issue every time. I "Windbg" the crash dump and it appears that the garbage collection thread is doing this while it's trying to cleanup RCW objects. I think the "3rd" time is irrelevant, I just think in my testing that's when the GC decides to collect.

I cannot consistently reproduce the error in a "slimmed down" outlook add-in using add-in express, but I have gotten it to crash at least once. Again, probably due to the whim of the garbage collector.

Can you guys reproduce this error?
Posted 15 Feb, 2019 18:48:50 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Josh,

I can't reproduce this issue. Does the issue persist if you comment out the code in the pane class?

Do you release COM objects in the code of the pane?


Andrei Smolin
Add-in Express Team Leader
Posted 18 Feb, 2019 01:54:06 Top
Josh Norris


Guest


My next step was to start commenting out code from the pane, yeah.

I DO release COM objects from the pane.
Posted 18 Feb, 2019 10:29:24 Top
Josh Norris


Guest


OK, I was able to get the code narrowed down enough to find the problem. There were actually two places in my code where I was iterating across COM collections using foreach instead of a for. And one of those was the Recipient list, where I was accessing the AddressEntry object of each recipient and not releasing it. It seems like the likely culprit. These COM errors are tough to track down. This code has been otherwise running (seemingly) flawlessly for 5+ years, but when initiated from MS access it blows up. Interesting, but I'm glad that I was so easily reproduce this issue.
Posted 18 Feb, 2019 12:49:44 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Josh,

My congratulations! Actually, starting the host application via automation is the easiest way to find some (all?) of the COM objects unreleased in an add-in. In this case every unreleased COM object matters!


Andrei Smolin
Add-in Express Team Leader
Posted 19 Feb, 2019 02:05:25 Top