Skip to content

Commit

Permalink
Add compatibility with std::unique_ptr. (#90)
Browse files Browse the repository at this point in the history
Authored-by: lnd3 <linus.cumselius@gmail.com>
  • Loading branch information
lnd3 authored Sep 2, 2023
1 parent 4f4dcc8 commit 17cf091
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/ofbx.h
Original file line number Diff line number Diff line change
Expand Up @@ -725,3 +725,20 @@ i64 secondsToFbxTime(double value);


} // namespace ofbx

#ifdef OFBX_DEFAULT_DELETER
#include <memory>

template <> struct ::std::default_delete<ofbx::IScene>
{
default_delete() = default;
template <class U> constexpr default_delete(default_delete<U>) noexcept {}
void operator()(ofbx::IScene* scene) const noexcept
{
if (scene)
{
scene->destroy();
}
}
};
#endif

0 comments on commit 17cf091

Please sign in to comment.