aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/imports
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2013-11-05 10:50:46 -0500
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-11-06 12:37:18 +0100
commitc8efdf6c33b7b32664b9a3837689a7be43957a5b (patch)
treed63ab04ccd2b48e0081659f3855380c1dbd1beb1 /share/qbs/imports
parent3fe1d168065116908cf23aab80229bd6aeb89889 (diff)
Add many missing calls to Process.close() and one to TextFile.close().
Change-Id: Idc4b1d8f73fe1d5fbff6c486cded825d640c5240 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'share/qbs/imports')
-rw-r--r--share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs52
1 files changed, 28 insertions, 24 deletions
diff --git a/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs b/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs
index 33b539d1f..07509034d 100644
--- a/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs
@@ -19,32 +19,36 @@ Probe {
if (!name)
throw '"name" must be specified';
var p = new Process();
- var args = [ name ];
- if (minVersion !== undefined)
- args.push(name + ' >= ' + minVersion);
- if (exactVersion !== undefined)
- args.push(name + ' = ' + exactVersion);
- if (maxVersion !== undefined)
- args.push(name + ' <= ' + maxVersion);
- if (p.exec(executable, args.concat([ '--cflags' ])) === 0) {
- cflags = p.readStdOut().trim();
- if (cflags === "")
- cflags = undefined;
- else
- cflags = cflags.split(/\s/);
- if (p.exec(executable, args.concat([ '--libs' ])) === 0) {
- libs = p.readStdOut().trim();
- if (libs === "")
- libs = undefined;
+ try {
+ var args = [ name ];
+ if (minVersion !== undefined)
+ args.push(name + ' >= ' + minVersion);
+ if (exactVersion !== undefined)
+ args.push(name + ' = ' + exactVersion);
+ if (maxVersion !== undefined)
+ args.push(name + ' <= ' + maxVersion);
+ if (p.exec(executable, args.concat([ '--cflags' ])) === 0) {
+ cflags = p.readStdOut().trim();
+ if (cflags === "")
+ cflags = undefined;
else
- libs = libs.split(/\s/);
- found = true;
- print("PkgConfigProbe: found library " + name);
- return;
+ cflags = cflags.split(/\s/);
+ if (p.exec(executable, args.concat([ '--libs' ])) === 0) {
+ libs = p.readStdOut().trim();
+ if (libs === "")
+ libs = undefined;
+ else
+ libs = libs.split(/\s/);
+ found = true;
+ print("PkgConfigProbe: found library " + name);
+ return;
+ }
}
+ found = false;
+ cflags = undefined;
+ libs = undefined;
+ } finally {
+ p.close();
}
- found = false;
- cflags = undefined;
- libs = undefined;
}
}