8000 [log4cplus-2.0.0-rc2] memory leak on exit · Issue #278 · log4cplus/log4cplus · GitHub
[go: up one dir, main page]

Skip to content
[log4cplus-2.0.0-rc2] memory leak on exit #278
Closed
@abronix

Description

@abronix

Hello!

How to reproduce the issue:

Make some application with logger.
For example: win8x64, release, static linkage with logger.
Start the application as win-console application.
Stop the application (Ctrl+C).

The issue description:

If application going to stop will be called

log4cplus::`anonymous namespace'::destroy_default_context::~destroy_default_context() Line 168	C++

and

log4cplus::`anonymous namespace'::alloc_dc() Line 179	C++
log4cplus::`anonymous namespace'::get_dc(bool alloc) Line 206	C++
log4cplus::shutdownThreadPool() Line 286	C++
log4cplus::Initializer::~Initializer() Line 115	C++

alloc_dc() will create the context again. This context will not be destroyed.
Well, we have memory leak.
What do you think about a fix of problem?

P.s.
In debug mode we have assertion (default_context_state is DC_DESTROYED)


alloc_dc ()
{
    assert (! default_context);
    assert(default_context_state == DC_UNINITIALIZED);    <<<<---
...


Best regards,
Yuriy

Metadata

Metadata

Assignees

Labels

bugde-/initializationissues dealing with initialization or deinitialization

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0