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. General Programming
  3. COM
  4. Dangling references

Dangling references

Scheduled Pinned Locked Moved COM
helpsysadminbeta-testingquestion
3 Posts 2 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.
  • J Offline
    J Offline
    Jamie Hale
    wrote on last edited by
    #1

    I have an out of proc server, and a buggy beta-ish client. There is always only a single instance of both client and server. Quite frequently, the client crashes before releasing its server reference. The one solution I've come up with for this problem, is to have the server keep track of when the client connects and disconnects (implement my own IConnectionPoints) so that if I get an Advise() call before the required Unadvise() call, I (the server) will decrement my own reference count. Is this as evil as it sounds? I get the feeling this is a kludge solution, and I'm hoping y'all can help me out. :) J

    S 1 Reply Last reply
    0
    • J Jamie Hale

      I have an out of proc server, and a buggy beta-ish client. There is always only a single instance of both client and server. Quite frequently, the client crashes before releasing its server reference. The one solution I've come up with for this problem, is to have the server keep track of when the client connects and disconnects (implement my own IConnectionPoints) so that if I get an Advise() call before the required Unadvise() call, I (the server) will decrement my own reference count. Is this as evil as it sounds? I get the feeling this is a kludge solution, and I'm hoping y'all can help me out. :) J

      S Offline
      S Offline
      Sayan Mukherjee
      wrote on last edited by
      #2

      Hi, Can you give some snapshots of the code? The out-of-process server - is it a DLL or an EXE? With best regards, Sayan Mukherjee

      J 1 Reply Last reply
      0
      • S Sayan Mukherjee

        Hi, Can you give some snapshots of the code? The out-of-process server - is it a DLL or an EXE? With best regards, Sayan Mukherjee

        J Offline
        J Offline
        Jamie Hale
        wrote on last edited by
        #3

        Ok, actually, it's not a problem that the client crashes. The client code is just one of our applications. The problem is that WHEN it crashes, it never gets around to Release()ing the interface on the OOP server object. It can't, because it crashes. My question is more about style. Is it OK for the OOP server object to Release() itself if I know that the client will never get around to it? J

        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