From: Simon Hausmann Date: Tue, 11 Mar 2014 13:22:34 +0000 (+0100) Subject: Avoid crash when unlinking compilation unit X-Git-Tag: upstream/5.3.1~297 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6d7976172d82b98d7f11efc1db86f0a99ff564f;p=platform%2Fupstream%2Fqtdeclarative.git Avoid crash when unlinking compilation unit Don't free static data Change-Id: I315b98841e1a44492d54ac2732743706c286e527 Reviewed-by: Lars Knoll --- diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 38c8414..ae495e0 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -151,7 +151,8 @@ void CompilationUnit::unlink() if (engine) engine->compilationUnits.erase(engine->compilationUnits.find(this)); engine = 0; - free(data); + if (data && !(data->flags & QV4::CompiledData::Unit::StaticData)) + free(data); data = 0; free(runtimeStrings); runtimeStrings = 0;