Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-350

File not closed when exception thrown in JavaScriptCommand's sourceCode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 1.1.0
    • 1.0.1
    • General
    • None
    • 81b9c927208215d14715f66fbf8e266dd442c727 617d1f73cf69b96e467e31bcc8a864b9184ebdae

    Description

      If an exception gets thrown while a file is opened (e.g. due to missspelled f.write in the example below) the file isn't closed by the build-process. I restart of Qt Creator is required in order to run the (then fixed) version of this command or to delete the build directory.

      For example a Rule has the following code as prepare-property:

      var cmd = new JavaScriptCommand();
      cmd.description = "Generating result for " + product.name;
      cmd.highlight = "codegen"
      cmd.sourceCode = function() {
      	var f = new TextFile(output.fileName, TextFile.WriteOnly);
      	f.wirte("Hello World!")
      	f.close();
      }
      return cmd;
      

      As files are special extensions to the javascript environment in QBS I would expect that they are tracked and automatically closed once a build finishes which doesn't seem to be the case.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jbornema Joerg Bornemann
            jmatokic Johannes Matokic
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes