1
0
mirror of https://github.com/Kopano-dev/kopano-ol-extension.git synced 2023-10-10 13:37:40 +02:00

Cleaned up some undisposed wrappers

This commit is contained in:
Patrick Simpson 2017-04-05 14:31:05 +02:00
parent 84aa4e10a1
commit 94e51f3a9f

View File

@ -390,12 +390,14 @@ namespace Acacia.Utils
private void HandleBeforeDelete(object item, ref bool cancel) private void HandleBeforeDelete(object item, ref bool cancel)
{ {
_events.OnBeforeDelete(item.WrapOrDefault<IItem>(), ref cancel); using (IItem wrapped = item.WrapOrDefault<IItem>(false))
_events.OnBeforeDelete(wrapped, ref cancel);
} }
private void HandleForward(object response, ref bool cancel) private void HandleForward(object response, ref bool cancel)
{ {
_events.OnForward(_item as IMailItem, response.WrapOrDefault<IMailItem>()); using (IItem wrapped = response.WrapOrDefault<IItem>(false))
_events.OnForward(_item as IMailItem, wrapped as IMailItem);
} }
private void HandleRead() private void HandleRead()
@ -405,12 +407,14 @@ namespace Acacia.Utils
private void HandleReply(object response, ref bool cancel) private void HandleReply(object response, ref bool cancel)
{ {
_events.OnReply(_item as IMailItem, response.WrapOrDefault<IMailItem>()); using (IItem wrapped = response.WrapOrDefault<IItem>(false))
_events.OnReply(_item as IMailItem, wrapped as IMailItem);
} }
private void HandleReplyAll(object response, ref bool cancel) private void HandleReplyAll(object response, ref bool cancel)
{ {
_events.OnReplyAll(_item as IMailItem, response.WrapOrDefault<IMailItem>()); using (IItem wrapped = response.WrapOrDefault<IItem>(false))
_events.OnReplyAll(_item as IMailItem, wrapped as IMailItem);
} }
private void HandleUnload() private void HandleUnload()