You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Event handler OnDevice is registered in wl_drm_listener
The code of the handler make the instance(in heap) of type DisplayWayland.
The class DisplayWayland inherits the Drm::Display, the ctor of which can throw the exception (type Exception)
In general - event handler must not throw the exception because there are not any guarantees that C code can handle it
see code
Reference:xen-troops#112
The event handler (onDevice) does not catch an exception.
The code is wrapped into try-catch block
Signed-off-by: Ihor Usyk <[email protected]>
Reference:xen-troops#112
The event handler (onDevice) does not catch an exception.
The code is wrapped into try-catch block
Signed-off-by: Ihor Usyk <[email protected]>
Description
Event handler OnDevice is registered in wl_drm_listener
The code of the handler make the instance(in heap) of type DisplayWayland.
The class DisplayWayland inherits the Drm::Display, the ctor of which can throw the exception (type Exception)
In general - event handler must not throw the exception because there are not any guarantees that C code can handle it
see code
void WaylandZCopy::onDevice(const string& name)
{
lock_guard lock(mMutex);
}
Display::Display ()
{
...
if (mDrmFd < 0)
{
throw Exception("Cannot open DRM device: " + mName, errno);
}
...
if (drmGetCap(mDrmFd, DRM_CAP_DUMB_BUFFER, &hasDumb) < 0 || !hasDumb)
{
throw Exception("Drm device does not support dumb buffers", errno);
}
}
Solution
Wrap code inside OnDevice in block try{}catch(const Exception&){}
The text was updated successfully, but these errors were encountered: