Fix the order of destruction. The draw target must be released before the gl context, as gl resources are present.