diff --git a/src/qml/jsruntime/qv4errorobject_p.h b/src/qml/jsruntime/qv4errorobject_p.h
index 6070fe6210792bd7f231cc5d756d295747043245..47442ad985bb94b5f34a2e58cb4cb6c42fd48a3b 100644
--- a/src/qml/jsruntime/qv4errorobject_p.h
+++ b/src/qml/jsruntime/qv4errorobject_p.h
@@ -71,7 +71,7 @@ struct ErrorObject: Object {
 
     static ReturnedValue method_get_stack(CallContext *ctx);
     static void markObjects(Managed *that, ExecutionEngine *e);
-    static void destroy(Managed *that) { static_cast<ErrorObject *>(that)->~ErrorObject(); }
+    static void destroy(Managed *that) { static_cast<ErrorObject *>(that)->d()->~Data(); }
 };
 
 template<>