[gnet-dev] memory leak in gnet



i look into the cvs about a memory leak into inetadress.c .
i patch the code in that way  to remove the memory leak:
void
gnet_inetaddr_unref (GInetAddr* inetaddr)
{
  g_return_if_fail(inetaddr != NULL);

    inetaddr->ref_count--;
//  inetaddr->ref_count++;

  if (inetaddr->ref_count == 0)
    {
      if (inetaddr->name != NULL)
 g_free (inetaddr->name);
      g_free (inetaddr);
    }
}





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]