Wireshark-bugs: [Wireshark-bugs] [Bug 7530] Memory leak of frame_data->opt_comment when closing
Date: Wed, 13 Mar 2013 14:15:45 +0000

Comment # 5 on bug 7530 from
(In reply to comment #3)
> (In reply to comment #2)
> > I think Jakub suggested to store the comments in a hashtable and just use a
> > flag in frame data whether there is a comment or not (to save memory). We
> > should perhaps differentiate between saved comments which can be read back
> > from file and comments added during the session which would have to be
> > preserved in memory. Re reading a file a check in the "new unsaved comments"
> > hastable could be done per frame - capacity loss? use a flag for empty table?
> > 
> > Or a more brutal approach "Unsaved comments exists - please (re)save your
> > file"
> > Regards
> > Anders
> 
> This makes sense to me, assuming there is a fast(ish) way to reread the
> comment on a specific frame from file?
> 
> To be sure I am following correctly:
> 
> Two boolean flags in frame data - one indicating 'saved comment' one
> indicating 'unsaved comment' (they might both be set if the user has
> modified a saved comment but not yet resaved). Saved comments are not stored
> in memory (they can be reread from file). Unsaved comments are stored in a
> hash table mapping frame number to string. On file close, we simply check if
> the hash table is empty using g_hash_table_size.

I haven' thougt to much about the details but something like that yes. If we
need fast access to all comments without reading the file we could have another
hastable for those.
If the file is rescanned and all frame data is freed we need to check the
unsaved hastable if non empty to recreate the unsaved comment flag.
Regards
Anders


You are receiving this mail because:
  • You are watching all bug changes.