Fixed memory leaks in chat logs

issue #226