diff --git a/src/html.cc b/src/html.cc
index b7c0f1f..b6992fc 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -473,7 +473,7 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
DocType = DT_NONE; /* assume Tag Soup 0.0! :-) */
DocTypeVersion = 0.0f;
- styleEngine = new StyleEngine (HT2LT (this), page_url, base_url, bw->zoom);
+ styleEngine = std::make_unique< StyleEngine >(HT2LT (this), page_url, base_url, bw->zoom);
cssUrls = new misc::SimpleVector (1);
@@ -578,8 +578,6 @@ DilloHtml::~DilloHtml()
dFree(img);
}
delete (images);
-
- delete styleEngine;
}
/**
diff --git a/src/html_common.hh b/src/html_common.hh
index 0c36efc..85f1850 100644
--- a/src/html_common.hh
+++ b/src/html_common.hh
@@ -188,7 +188,7 @@ public: //BUG: for now everything is public
lout::misc::SimpleVector *cssUrls;
lout::misc::SimpleVector *stack;
- StyleEngine *styleEngine;
+ std::unique_ptr< StyleEngine > styleEngine;
int InFlags; /**< tracks which elements we are in */