Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question)

I'm ready to pack it in. I've been outsmarted by .NET's garbage collector (A rant, not a question)

Scheduled Pinned Locked Moved The Lounge
helpannouncementcsharpc++winforms
22 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Stuart Dootson

    I did it slightly differently - I wrote a class to implement something like an [Objective-C autorelease pool](https://www.informit.com/articles/article.aspx?p=1806938&seqNum=7), which our COM object wrappers added themselves to automatically. The pool was released in a [`finally` block](https://docs.oracle.com/javase/tutorial/essential/exceptions/finally.html) & that would release all the COM objects that had been allocated and finished - something like this... ```java AutoReleasePool.createPool(); // Push a new pool onto the stack of pools try { ... Do stuff ... } finally { AutoReleasePool.releasePool(); // Pop the top pool in the stack , releasing all the objects in it } ```

    Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

    honey the codewitchH Offline
    honey the codewitchH Offline
    honey the codewitch
    wrote on last edited by
    #21

    that seems even more complicated, but you do you. I don't know the whole picture anyway so I'm just talking smack here. :laugh:

    Real programmers use butterflies

    S 1 Reply Last reply
    0
    • honey the codewitchH honey the codewitch

      that seems even more complicated, but you do you. I don't know the whole picture anyway so I'm just talking smack here. :laugh:

      Real programmers use butterflies

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #22

      Yeah, completely different scenario - I was dealing with potentially hundreds of thousands of COM objects that needed to be created from Java, so couldn't go with a single C memory reference.

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups