Re: [PATCH] riched20: Don't create too many IRichEditOle interfaces for a RichEdit.
On Wed, Jun 25, 2014 at 01:59:42PM +0800, Jactry Zeng wrote:
@@ -1502,6 +1503,13 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj) { IRichEditOleImpl *reo;
+ if (editor->reOle) + { + reo = editor->reOle; + reo->ref++; + *ppObj = reo; + return 1; + } reo = heap_alloc(sizeof(IRichEditOleImpl)); if (!reo) return 0;
This is not the way to do this. You want to be calling AddRef on the interface. You probably want to do the if(editor->reOle) check in the EM_GETOLEINTERFACE handler and only call this constructor when needed. Huw.
2014-06-25 16:24 GMT+08:00 Huw Davies <huw(a)codeweavers.com>:
This is not the way to do this. You want to be calling AddRef on the interface. You probably want to do the if(editor->reOle) check in the EM_GETOLEINTERFACE handler and only call this constructor when needed.
Thanks Huw! A newer version will be sent. -- Regards, Jactry Zeng
participants (2)
-
Huw Davies -
Jactry Zeng