filter-transform: Destructor comes before Constructors

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2019-01-24 04:33:56 +01:00
parent c1441e72c0
commit ff6176d7bc
2 changed files with 10 additions and 10 deletions

View file

@ -297,6 +297,15 @@ void filter::TransformAddon::video_render(void* ptr, gs_effect_t* effect)
reinterpret_cast<Transform*>(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

View file

@ -84,8 +84,8 @@ namespace filter {
std::unique_ptr<util::vec3a> 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();