summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-29 16:22:52 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-30 18:42:12 +0200
commiteeb6001b6c5517b27c3cf412ff6053780e59d25d (patch)
tree3d50d1d0410b70f9274e27e0fe2d089206e90909 /src
parent548d6a0dff71854b0c6f68a3dbecf98da37b798d (diff)
downloadqttools-eeb6001b6c5517b27c3cf412ff6053780e59d25d.tar.gz
Return from main instead of exit()ing in qdbus
This way, the automatic variables' destructors will be run. Change-Id: I2550969a0dde981f2de14be0ddaae285b68181db Reviewed-by: L Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/qdbus/qdbus/qdbus.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qdbus/qdbus/qdbus.cpp b/src/qdbus/qdbus/qdbus.cpp
index b5fc37aa2..af0db01cf 100644
--- a/src/qdbus/qdbus/qdbus.cpp
+++ b/src/qdbus/qdbus/qdbus.cpp
@@ -482,7 +482,7 @@ int main(int argc, char **argv)
QDBusConnectionInterface *bus = connection.interface();
if (args.isEmpty()) {
printAllServices(bus);
- exit(0);
+ return 0;
}
QString service = args.takeFirst();
@@ -492,22 +492,22 @@ int main(int argc, char **argv)
return 0;
}
fprintf(stderr, "Service '%s' is not a valid name.\n", qPrintable(service));
- exit(1);
+ return 1;
}
if (args.isEmpty()) {
listObjects(service, QString());
- exit(0);
+ return 0;
}
QString path = args.takeFirst();
if (!QDBusUtil::isValidObjectPath(path)) {
fprintf(stderr, "Path '%s' is not a valid path name.\n", qPrintable(path));
- exit(1);
+ return 1;
}
if (args.isEmpty()) {
listAllInterfaces(service, path);
- exit(0);
+ return 0;
}
QString interface = args.takeFirst();
@@ -526,10 +526,10 @@ int main(int argc, char **argv)
}
if (!QDBusUtil::isValidMemberName(member)) {
fprintf(stderr, "Method name '%s' is not a valid member name.\n", qPrintable(member));
- exit(1);
+ return 1;
}
int ret = placeCall(service, path, interface, member, args);
- exit(ret);
+ return ret;
}