Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in ~Logger() #3

Closed
zkasa opened this issue Apr 4, 2013 · 2 comments
Closed

Crash in ~Logger() #3

zkasa opened this issue Apr 4, 2013 · 2 comments

Comments

@zkasa
Copy link

zkasa commented Apr 4, 2013

Приветствую!
Надеюсь, меня поймут :)

Хороший логгер, спасибо за мое время. Однако, обнаружил тут мелкий глюк в деструкторе.

Logger::~Logger()
{
Q_D(Logger);

// Cleanup appenders
QMutexLocker appendersLocker(&d->appendersMutex);
foreach (AbstractAppender* appender, d->appenders)
delete appender;

// Cleanup device
delete d->logDevice;

delete d_ptr;
}

appendersLocker пытается разлокать мутекс по выходу из деструктора, но мутекс уже уничтожен, т.к. он сидит в d_ptr - падает, соответственно.
доп. область видимости спасла бы "отца русской демократии" :)

@zkasa
Copy link
Author

zkasa commented Apr 23, 2013

hello, someone sees me?

@alorence alorence mentioned this issue May 9, 2013
cyberbobs added a commit that referenced this issue Jun 21, 2013
…c0b64ca

Fix issue #3: unlock mutex before deleting its parent
@cyberbobs
Copy link
Member

По какой-то причине мне не приходили уведомления ни об issue, ни о pull request. Но здесь уже помогли починить :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants