Memory leak in AdvRichEditor

I was adding an image to the AdvRichEditor (1.8.2.9) with AdvRichEditorMiniHTMLIO (PlainHTML option set), save and restoring it to the editor. I also use the option:
AdvRichEditor.HTMLImages := igInline;

When I exited the app, EurekaLog reported a memory leak with this info:

Application has leaked memory: Total size=73800; Count=6.

[01EFAC52] AdvRichEditorDD.TEnumFormats.SomeStream (Line 396, "AdvRichEditorDD.pas")
[01EFADF7] AdvRichEditorDD.TEnumFormats.Stream (Line 453, "AdvRichEditorDD.pas")
[01EFB3DB] AdvRichEditorDD.TRichEditorDropTarget.Drop (Line 629, "AdvRichEditorDD.pas")
[76BB0A39] ole32.GetActiveObjectExt
[76BB08B2] ole32.GetActiveObjectExt
[76B77BFF] ole32.OleGetPackageClipboardOwner
[76B77518] ole32.OleGetPackageClipboardOwner
[76B7A8B6] ole32.DoDragDrop
[01EFBCFC] AdvRichEditorDD.StartTextDoDragDrop (Line 987, "AdvRichEditorDD.pas")
[01F0BA2E] AdvRichEditor.TAdvRichEditor.MouseMoveN (Line 6168, "AdvRichEditor.pas")
[01E99DB0] AdvScrollControl.TCustomScrollingControl.MouseMove (Line 447, "AdvScrollControl.pas")
[006E39D6] Vcl.Controls.TControl.WMMouseMove (Line 7712, "Vcl.Controls.pas")
[006E7FD7] Vcl.Controls.TWinControl.WndProc (Line 10424, "Vcl.Controls.pas")
[007BE0A4] Vcl.Themes.TStyleHook.CallDefaultProc (Line 7037, "Vcl.Themes.pas")
[007BE256] Vcl.Themes.TStyleHook.HandleMessage (Line 7110, "Vcl.Themes.pas")
[007BB2E4] Vcl.Themes.TStyleManager.HandleMessage (Line 5665, "Vcl.Themes.pas")
[006E62C3] Vcl.Controls.TWinControl.DoHandleStyleMessage (Line 9344, "Vcl.Controls.pas")
[006E752C] Vcl.Controls.TWinControl.MainWndProc (Line 10113, "Vcl.Controls.pas")
[005642D8] System.Classes.StdWndProc (Line 18021, "System.Classes.pas")
[75F4EF63] USER32 (possible AddClipboardFormatListener+67)
[75F45EF5] USER32 (possible GetClassLongW+1957)
[75F43C55] USER32 (possible DispatchMessageW+581)
[75F43A1B] USER32.DispatchMessageW
[0081B367] Vcl.Forms.TApplication.ProcessMessage (Line 11028, "Vcl.Forms.pas")
[00550BEE] System.Classes.TMemoryStream.Realloc (Line 9707, "System.Classes.pas")
[00550B5E] System.Classes.TMemoryStream.SetSize (Line 9680, "System.Classes.pas")
[01EFADF7] AdvRichEditorDD.TEnumFormats.Stream (Line 453, "AdvRichEditorDD.pas")
[01EFB3DB] AdvRichEditorDD.TRichEditorDropTarget.Drop (Line 629, "AdvRichEditorDD.pas")
[76BB0A39] ole32.GetActiveObjectExt
[76BB08B2] ole32.GetActiveObjectExt
[76B77BFF] ole32.OleGetPackageClipboardOwner
[76B77518] ole32.OleGetPackageClipboardOwner
[76B7A8B6] ole32.DoDragDrop
[01EFBCFC] AdvRichEditorDD.StartTextDoDragDrop (Line 987, "AdvRichEditorDD.pas")
[01F0BA2E] AdvRichEditor.TAdvRichEditor.MouseMoveN (Line 6168, "AdvRichEditor.pas")
[01E99DB0] AdvScrollControl.TCustomScrollingControl.MouseMove (Line 447, "AdvScrollControl.pas")
[006E39D6] Vcl.Controls.TControl.WMMouseMove (Line 7712, "Vcl.Controls.pas")
[006E7FD7] Vcl.Controls.TWinControl.WndProc (Line 10424, "Vcl.Controls.pas")
[007BE0A4] Vcl.Themes.TStyleHook.CallDefaultProc (Line 7037, "Vcl.Themes.pas")
[007BE256] Vcl.Themes.TStyleHook.HandleMessage (Line 7110, "Vcl.Themes.pas")
[007BB2E4] Vcl.Themes.TStyleManager.HandleMessage (Line 5665, "Vcl.Themes.pas")
[006E62C3] Vcl.Controls.TWinControl.DoHandleStyleMessage (Line 9344, "Vcl.Controls.pas")
[006E752C] Vcl.Controls.TWinControl.MainWndProc (Line 10113, "Vcl.Controls.pas")
[005642D8] System.Classes.StdWndProc (Line 18021, "System.Classes.pas")
[75F4EF63] USER32 (possible AddClipboardFormatListener+67)
[75F45EF5] USER32 (possible GetClassLongW+1957)
[75F43C55] USER32 (possible DispatchMessageW+581)
[75F43A1B] USER32.DispatchMessageW
[0081B367] Vcl.Forms.TApplication.ProcessMessage (Line 11028, "Vcl.Forms.pas")

I have retested this here but I could not see a memory leak so far.
Although not specified in your report, I assume you use the AdvRichEditorHTMLIO to persist.

Test code used:

procedure TForm1.Button1Click(Sender: TObject);
begin
  advricheditorhtmlio1.Save('e:\tms\temp\riched.html');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  advricheditorhtmlio1.Load('e:\tms\temp\riched.html');
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
   AdvRichEditor1.HTMLImages := igInline;
   ReportMemoryLeaksOnShutdown := true;
end;

Not sure what you mean about "I assume you use the AdvRichEditorHTMLIO to persist"?

I use it to load from a string (vHtml is a TStringList I load from a TMemoryStream):

        vHtml := TStringList.Create;
        try
          vHtml.LoadFromStream(vEmailTemplate.Layout);
          if vHtml.Text <> '' then
            AdvRichEditorMiniHTMLIO1.Insert(vHtml.Text);
        finally
          FreeAndNil(vHtml);
        end;

However, I save differently using the editor, not AdvRichEditorMiniHTMLIO1:

      vHtml := TStringList.Create;
      try
        vHtml.Text := reEmailBody.ContentAsPlainHTML();
        vEmailTemplate.Layout.Clear;
        vHtml.SaveToStream(vEmailTemplate.Layout);
      finally
        FreeAndNil(vHtml);
      end;

This all works fine in normal usage, even just adding or removing an image and does not cause the memory leak. I'm not sure what scenario I did to cause it (correction, keep reading), but at the time I was trying to see why the image was moving from the left of text to the right of it after saving and reloading (posted in another ticket). I kept editing the text and adding images etc. And when I closed my app out of debug, it reported this error.

Usually when I get a report I can using see in my code what object is not being freed. I was hoping you could do the same. Based on what I see in the bug report, the TMemoryStream you are creating in the SomeStream function is not being freed.

Since I see a TRichEditorDropTarget.Drop function being executed, I just tried editing again and this time I simply tried dragging the existing image from the right side to the left. It didn't move, but when I exited my app, I got the memory leak. So something in a drag drop operation with an existing image is causing the memory leak. Hope that helps you reproduce.

We could trace & solve this now.
The next update will address this.