Possible Bug IEventData

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Possible Bug IEventData

      I am currently reading through your book during my assignment I have to do
      in my master studies. In chapter 11 there could be a possible memory
      leak:

      typedef shared_ptr<IEventData> IEventDataPtr; but IEventData has no virtual
      ~IEventData()

      The implementation of a scenario with self implemented shared_ptr and
      boost::shared_ptr resulted in memory leaks. No call of derived Event Dtors.
      Possibly I am doing something wrong...

      Thanks for the exciting stories. Sometimes I can identify myself with a few
      of those tales :D

      Greetz from an ongoing game developer from FH-Salzburg/Austria
      3,14159285358979323846f
    • RE: Possible Bug IEventData

      We're using the C++ 11 shared_ptr found in Visual Studio 2010 and never found a memory leak so if you're using your own implementation, there may be an issue there.

      Either way, not having a virtual destructor in IEventData was an oversight on my part, so I'll add it now. Thanks for the heads up. :)

      -Rez
    • RE: Possible Bug IEventData

      Originally posted by rezination
      We're using the C++ 11 shared_ptr found in Visual Studio 2010 and never found a memory leak so if you're using your own implementation, there may be an issue there.


      I guess my implementation is fine, because there are several system tests checking my subsystems ...

      Maybe your last instance was (luckily) always a shared_ptr::T != IEventData :D
      3,14159285358979323846f