Remove destructor from OBSPropertiesView

This commit is contained in:
Palana 2014-09-30 15:32:50 +02:00
parent 94a93abb2b
commit 7c0018d4bc
2 changed files with 7 additions and 8 deletions

View File

@ -58,7 +58,7 @@ void OBSPropertiesView::RefreshProperties()
layout->setSizeConstraint(QLayout::SetMaximumSize); layout->setSizeConstraint(QLayout::SetMaximumSize);
layout->setLabelAlignment(Qt::AlignRight); layout->setLabelAlignment(Qt::AlignRight);
obs_property_t *property = obs_properties_first(properties); obs_property_t *property = obs_properties_first(properties.get());
while (property) { while (property) {
AddProperty(property, layout); AddProperty(property, layout);
@ -81,7 +81,7 @@ OBSPropertiesView::OBSPropertiesView(OBSData settings_,
PropertiesUpdateCallback callback_, int minSize_) PropertiesUpdateCallback callback_, int minSize_)
: QScrollArea (nullptr), : QScrollArea (nullptr),
widget (nullptr), widget (nullptr),
properties (properties_), properties (properties_, obs_properties_destroy),
settings (settings_), settings (settings_),
obj (obj_), obj (obj_),
callback (callback_), callback (callback_),

View File

@ -48,9 +48,13 @@ class OBSPropertiesView : public QScrollArea {
friend class WidgetInfo; friend class WidgetInfo;
using properties_delete_t = decltype(&obs_properties_destroy);
using properties_t =
std::unique_ptr<obs_properties_t, properties_delete_t>;
private: private:
QWidget *widget; QWidget *widget;
obs_properties_t *properties; properties_t properties;
OBSData settings; OBSData settings;
void *obj; void *obj;
PropertiesUpdateCallback callback; PropertiesUpdateCallback callback;
@ -87,9 +91,4 @@ public:
obs_properties_t *properties, obs_properties_t *properties,
void *obj, PropertiesUpdateCallback callback, void *obj, PropertiesUpdateCallback callback,
int minSize = 0); int minSize = 0);
inline ~OBSPropertiesView()
{
obs_properties_destroy(properties);
}
}; };