SchneiderInfosystems / FB4D

Open Source Library for connecting Firebase by Delphi VCL/FMX
https://www.schneider-infosys.ch/DelphiBlog/de/#FB4D
Apache License 2.0
175 stars 51 forks source link

Memory leaks when creating a FirestoreListener #104

Closed ValidationFailed closed 3 years ago

ValidationFailed commented 3 years ago

Describe the bug When at least one instance of a FirestoreListener is being created during a programs lifetime, Delphi reports memory leaks when closing the program with the setting ReportMemoryLeaksOnShutdown =: true.

To Reproduce Steps to reproduce the behavior:

  1. Launch the DempFB4D.exe program you've provided us with
  2. Click Anonymous Login
  3. Create a FirestoreListener (with edtCollectionIDForFSListener.Text := "/")
  4. Stop the FirestoreListener
  5. Close the program

Doing just that, a window pops up which reports a couple of memory leaks. The results of this issue are the same like it's been reported in #82 already. The difference is that the memory leaks don't occur when you don't stop the listener, but just close the program, which confirms the success of the fix for #82. :)

Screenshots Creating and stopping a listener, as shown in the following image: grafik ... results in: grafik ... while starting a listener and closing the program without stopping it doesn't result in any memory leaks.

Additional Info:

ValidationFailed commented 3 years ago

I just found out that there's a memory leak basically any time you work with the firestore (when inserting a document, getting a document, deleting a document).

SchneiderInfosystems commented 3 years ago

Can you check FB4D-version 1.2.5.386. I made a correction for Delphi 10.4.2. The leak should be fixed.

ValidationFailed commented 3 years ago

Oh, I'm sorry, it seems like I've been behind for a few versions.. Sorry for wasting your time and thanks a lot for your reply!