diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index 95e04d69992942ec4507bd6c6937189125d906f5..637f3ea369db1c09aea1a70b5d73e0bb86287333 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -173,10 +173,10 @@ bool UIDelegatesManager::ensureComponentLoaded(ComponentType type)
     *component = (new QQmlComponent(engine, QUrl::fromLocalFile(fi.absoluteFilePath()), QQmlComponent::PreferSynchronous, m_view));
 
     if ((*component)->status() != QQmlComponent::Ready) {
-#ifdef UI_DELEGATES_DEBUG
         Q_FOREACH (const QQmlError& err, (*component)->errors())
-            fprintf(stderr, "  component error: %s\n", qPrintable(err.toString()));
-#endif
+            qWarning("QtWebEngine: component error: %s\n", qPrintable(err.toString()));
+        delete *component;
+        *component = 0;
         return false;
     }
     return true;