diff --git a/source/filter-transform.cpp b/source/filter-transform.cpp index 1e7de7f2..dcffd9eb 100644 --- a/source/filter-transform.cpp +++ b/source/filter-transform.cpp @@ -297,6 +297,15 @@ void filter::TransformAddon::video_render(void* ptr, gs_effect_t* effect) reinterpret_cast(ptr)->video_render(effect); } +filter::Transform::~Transform() +{ + obs_enter_graphics(); + shape_rt.reset(); + source_rt.reset(); + vertex_buffer.reset(); + obs_leave_graphics(); +} + filter::Transform::Transform(obs_data_t* data, obs_source_t* context) : source_context(context), is_orthographic(true), field_of_view(90.0), is_inactive(false), is_hidden(false), is_mesh_update_required(false), rotation_order(RotationOrder::ZXY) @@ -323,15 +332,6 @@ filter::Transform::Transform(obs_data_t* data, obs_source_t* context) update(data); } -filter::Transform::~Transform() -{ - obs_enter_graphics(); - shape_rt.reset(); - source_rt.reset(); - vertex_buffer.reset(); - obs_leave_graphics(); -} - void filter::Transform::update(obs_data_t* data) { // Camera diff --git a/source/filter-transform.hpp b/source/filter-transform.hpp index 3ade078d..5030b7d6 100644 --- a/source/filter-transform.hpp +++ b/source/filter-transform.hpp @@ -84,8 +84,8 @@ namespace filter { std::unique_ptr shear; public: - Transform(obs_data_t*, obs_source_t*); ~Transform(); + Transform(obs_data_t*, obs_source_t*); void update(obs_data_t*); uint32_t get_width();