Use in-class member initializers

This commit is contained in:
Chris Thrasher 2024-05-28 06:25:50 +00:00
parent b39e2ce0b5
commit e66cc278b9
No known key found for this signature in database
GPG Key ID: 56FB686C9DFC8E2C

View File

@ -86,8 +86,7 @@ class GlxErrorHandler
public: public:
explicit GlxErrorHandler(::Display* display) : m_display(display) explicit GlxErrorHandler(::Display* display) : m_display(display)
{ {
glxErrorOccurred = false; glxErrorOccurred = false;
m_previousHandler = XSetErrorHandler(handleXError);
} }
~GlxErrorHandler() ~GlxErrorHandler()
@ -99,7 +98,7 @@ public:
private: private:
std::lock_guard<std::recursive_mutex> m_lock{glxErrorMutex}; std::lock_guard<std::recursive_mutex> m_lock{glxErrorMutex};
::Display* m_display; ::Display* m_display;
int (*m_previousHandler)(::Display*, XErrorEvent*); int (*m_previousHandler)(::Display*, XErrorEvent*){XSetErrorHandler(handleXError)};
}; };
} // namespace } // namespace