Long time to use mirc, but hi,

I'm facing a COM memory leak that resulting mirc to increase the RAM usage when using the following code, it seems mirc doesn't free the memory somewhere there correctly, i cannot reproduce it by using a smaller code rather just this.

To reproduce it run: /timer[BUG] 100 10 check_bug https://screenrant.com/feed/ and check when this timer halts the mirc memory under task manager, and you will see that something there isn't being freed correctly, code tested under clean portable mirc 7.68 version.

Code
alias check_bug {
  ; /check_bug <LINK>

  var %com1 = rss1_ $+ $rand(1,10000000000) $+ $ticks
  var %com2 = rss2_ $+ $rand(1,10000000000) $+ $ticks
  var %com3 = rss3_ $+ $rand(1,10000000000) $+ $ticks
  var %itemcol = itemcol_ $+ $rand(1,10000000000) $+ $ticks

  .comopen %com1 MSXML2.DOMDocument.6.0

  if (!$com(%com1)) || ($comerr) { echo -tag Unable to create an instance of MSXML2.DOMDocument.6.0 COM! | goto end }
  if (!$com(%com1, async, 4, bool, false)) || ($comerr) { echo -tag Unable to set async property! | goto end }
  if (!$com(%com1, load, 1, bstr*, $1)) || ($comerr) { echo -tag Unable to load XML from source! | goto end }
  if (!$com(%com1, selectnodes, 1, bstr*, /rss/channel/item, dispatch* %itemcol)) || ($comerr) { echo -tag Unable to select nodes /rss/channel/item COM! | goto end }

  var %t = $comval(%itemcol,0)

  if (!%t) { echo -tag There was NOT any RSS Feed items founded! | goto end }

  if (%t > 10) { var %t = 10 }

  var %i = 1
  while (%i <= %t) {
    if (!$com(%itemcol, item, 1, uint, %i, dispatch* %com2)) || ($comerr) { echo -tag Cannot dispatch XML for individual item to new object! | goto end }

    if (!$com(%com2)) { goto next_item }

    .comclose %com2 $com(%com2, childnodes, 3, dispatch* %com3)

    if (!$com(%com3)) { goto next_item }

    var %n = $comval(%com3,0)
    var %c = 1

    while (%c <= %n) {
      if ($comval(%com3,%c,tagName) == title) { var %title = $comval(%com3,%c,text) }
      if ($comval(%com3,%c,tagName) == link) { 
        var %link = $comval(%com3,%c,text)

        ;if (%title) && (%link) { echo -tag %link %title }
      }

      inc %c
    }

    .comclose %com3

    :next_item
    inc %i
  }

  :error
  if ($error) { reseterror }

  :end

  if ($com(%com1)) { .comclose $v1 }
  if ($com(%com2)) { .comclose $v1 }
  if ($com(%com3)) { .comclose $v1 }
  if ($com(%itemcol)) { .comclose $v1 }
}



Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-