why do you need to do this?
Internally, FBO is just an component that refers a (or more) texture as its render target. It barely cost much (if any) extra memory.
If for some reason you really don’t want your FBO anymore (for instance, your FBO has multiple render targets and you don’t need others anymore, or you want discard the depth texture), simply do
auto tex = mFbo->getColorTexture(0);
and reset your fbo. Since the new texture is a shared pointer, that particular one won’t be freed.