Skip to content
Snippets Groups Projects
Commit 0f6632c5 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Fix ScopedGuard crash on GCC 4.7.3 (Bug#1189470)

parent fd1b45f5
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ class ScopedGuard {
ScopedGuard(ScopedGuard&& guard)
: m_fun(guard.m_fun), m_active(true) {
guard.m_active = false;
abort();
}
~ScopedGuard()
......@@ -54,16 +55,16 @@ class ScopedGuard {
}
private:
ScopedGuard(const ScopedGuard&) = delete;
explicit ScopedGuard(const ScopedGuard&) = delete;
ScopedGuard& operator=(const ScopedGuard&) = delete;
const Functor& m_fun;
Functor m_fun;
bool m_active;
};
template <typename Functor>
inline ScopedGuard<Functor>
make_scoped_guard(const Functor& guard)
make_scoped_guard(Functor guard)
{
return ScopedGuard<Functor>(guard);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment