cginternals / globjects

C++ library strictly wrapping OpenGL objects.
https://globjects.org
MIT License
539 stars 59 forks source link

Framebuffer::detach() : Fails for attachmentObject->isRenderBufferAttachment() #384

Closed richardebel closed 5 years ago

richardebel commented 5 years ago

Changed code: else if (attachmentObject->isRenderBufferAttachment()) { implementation().attachRenderBuffer(this, attachment, nullptr); }

To: else if (attachmentObject->isRenderBufferAttachment()) { implementation().attachRenderBuffer(this, attachment, attachmentObject->asRenderBufferAttachment()->renderBuffer()); }

scheibel commented 5 years ago

Thanks for reporting. I solved the issue by explicitly handling the nullptr case. Your solution would not crash but does not detach the renderbuffer either.