Menu

Memory leak in scanner

Help
2003-09-26
2003-10-13
  • Nobody/Anonymous

    Hi,

    I think the generated scanner leaks some
    memory. I was able to fix this by defining an
    onDestroy method in the syntax file in the code
    section of the scanner as follows:

    void onDestroy()
    {
      delete[] _buffer;
     
      t_laCell *p = (_laEnd ? _laEnd->next : 0);
      while (p && (p != _laEnd))
      {
        t_laCell *q = p->next;
        delete p;
        p = q;
      }
      delete  _laEnd;
    }

    This couuld probably be improved but it seems
    to work for me.

    Thanks for a great product!

     
    • Alec Panovici

      Alec Panovici - 2003-10-13

      Hi,

      That's right, i seem to have completely forgot about that bit. It's fixed in 0.0.6

      Thanks for spotting it,
      Alec.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.