summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2011-11-09 00:11:30 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-29 17:08:39 +0100
commit1c5db1aff34a3dbb8f24d8edb96e138eb1509d44 (patch)
tree592482597cea5dc86a5cf3472b79ba3d8aee9ccb /src
parented0b262de97dd92c831127909ea4c059962b86ce (diff)
Initialize the return value of signals
Before, the constructor was called for complex objects, but POD were left unitinialized. Now, they are zero-initialized. Also add test for return values Change-Id: Iff9bf6687589d7b7395a71fb6f650ab8aa2b6bd1 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/tools/moc/generator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 81508d1a09..7a9684fd02 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -1051,7 +1051,7 @@ void Generator::generateSignal(FunctionDef *def,int index)
}
fprintf(out, ")%s\n{\n", constQualifier);
if (def->type.name.size() && def->normalizedType.size())
- fprintf(out, " %s _t0;\n", noRef(def->normalizedType).constData());
+ fprintf(out, " %s _t0 = %s();\n", noRef(def->normalizedType).constData(), noRef(def->normalizedType).constData());
fprintf(out, " void *_a[] = { ");
if (def->normalizedType.isEmpty()) {