Opened 12 years ago
Closed 12 years ago
Last modified 11 years ago
#12131 closed Patch - Bug Fix (fixed)
Memory leak in LoggingItem::setThreadName()
| Reported by: | Owned by: | JYA | |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.27.2 |
| Component: | MythTV - General | Version: | 0.27-fixes |
| Severity: | medium | Keywords: | |
| Cc: | Stuart Auchterlonie | Ticket locked: | no |
Description
This inline method is called thousands of times, mostly via MPoolThread::run's calls to loggingRegisterThread, so the old value of m_threadName needs to be freed before a new value is set.
Attachments (1)
Change History (9)
by , 12 years ago
| Attachment: | logging.patch added |
|---|
comment:2 by , 12 years ago
This setter is the only one that popped up in the valgrind run that prompted me to test and then offer this patch, but that doesn't mean similar changes shouldn't be made to the other setters. I was also wondering if the project has any rules of thumb regarding the size and frequency of use of inline methods. IOW, should this setter (and maybe others) be moved to logging.cpp?
comment:3 by , 12 years ago
| Cc: | added |
|---|
Replying to dekarl:
After a quick look at the patch and file I'm wondering if the various setters that use strdup shouldn't all be doing the same.
Yes i think they should!
comment:4 by , 12 years ago
| Owner: | set to |
|---|---|
| Status: | new → accepted |
comment:5 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
comment:8 by , 11 years ago
| Milestone: | unknown → 0.27.2 |
|---|

After a quick look at the patch and file I'm wondering if the various setters that use strdup shouldn't all be doing the same.