Hi,

I have a simple QML application where I open a FileDialog when a button is pressed.

I have realized that when I open the FileDialog the current application memory is increased a lot (12 Mb only with the dialog), so I have added a Loader to the FileDialog. Therefore, the memory is only increased when I open the dialog. But my problem is that I can not free this memory, even setting the Loader source to "".

My test file:

Qt Code:
  1. import QtQuick 2.0
  2. import QtQuick.Controls 1.4
  3.  
  4. Item {
  5. width: 400
  6. height: 400
  7.  
  8. Loader {
  9. id: loaderFileDialog
  10. }
  11.  
  12. Connections {
  13. target: loaderFileDialog.item
  14. onAccepted: {
  15. loaderFileDialog.source = "";
  16. console.log("onAccepted");
  17. }
  18. onRejected: {
  19. loaderFileDialog.source = "";
  20. console.log("onCancel");
  21. }
  22. }
  23.  
  24. Button {
  25. anchors.centerIn: parent
  26.  
  27. width: 100
  28. height: 50
  29.  
  30. text: "Open file";
  31.  
  32. onClicked: {
  33. loaderFileDialog.source = "qrc:/MyFileDialog.qml";
  34. loaderFileDialog.item.visible = true;
  35. }
  36. }
  37. }
To copy to clipboard, switch view to plain text mode 

And my QML file with the FileDialog: MyFileDialog.qml

Qt Code:
  1. import QtQuick 2.1
  2. import QtQuick.Dialogs 1.0
  3.  
  4. FileDialog {
  5. id: fileDialog
  6. }
To copy to clipboard, switch view to plain text mode 

What am I doing wrong? Any idea or suggestion?

Thanks a lot in advance,
Diego