djjd47130 / JD-TMDB

TMDB API Wrapper for Delphi
MIT License
4 stars 0 forks source link

Memory Leaks!!! #5

Open djjd47130 opened 1 week ago

djjd47130 commented 1 week ago

I've been chasing several memory leaks related to the interface/implementation mechanism and reference-counting. Some interface structures, such as lists and list items, work just fine, with no leaks. Others, however, leak not only the items themselves, but many other things, all the way down to Indy TId... components. I've made efforts to replicate the working ones to the leaking ones, but still to no avail. I suspect the application's implementation has a lot to do with it, and not so much the API wrapper itself.

EXAMPLE:

  1. Run test app in debug
  2. Login / Logout
  3. Go to Search / Movies - don't do a search yet, but note how it populated Language and Region combo boxes
  4. Close app. Note no memory leaks.

But now...

  1. Run test app in debug
  2. Go to Search / Movies and perform a search for a movie
  3. Close app. Note the heap of memory leaks.

Other things which leak:

  1. Certifications > Movies and TV
  2. Genres > Movies and TV

Other things which DON'T leak:

  1. Configuration > Countries
djjd47130 commented 4 days ago

One thing I noted regarding "Genres" leaking... it has nothing to do with the interface / implementation structure. When fetching genre details for Movies, for example, there are no leaks. But when you navigate in the test app to the "Genres" section and show the list of genres, that's when the leak occurs.