Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

question..

Help
gobuksun
2009-04-10
2013-04-16
  • gobuksun
    gobuksun
    2009-04-10

    First, thanks for your great article. you did really good job Arne Steinarson. Wink
    I think this DynObj could be generated with CLI or JNI.
    Do you have any plan to make DynObj for using in C# or JAVA ? I hope so ^^;

    one more.

    I have found memory leak from DoRunTime.cpp (line 219)

    DoRunTimeC &DoRunTimeC::GetInstance( bool do_get ){_CFE_;
    if( do_get ){
    if( !g_pdort && g_dort_ok>=0 &&
    DelaySingleton<DoRunTimeC>::ms_ref_cnt>0 ){
    g_pdort = new DoRunTimeC;
    doSetRunTime( g_pdort );
    int sz_dynobj = GetVTableSizeOf<DynObj,void>();
    }
    }
    else {
    // Request to destroy the one instance
    if( g_pdort ){
    // Dismantle any references to tracked objects, it won't work after
    // setting DORT==NULL.
    g_pdort->FreeTrackers();
    doSetRunTime( NULL );
    g_pdort->doDestroy();
    g_pdort = NULL;

    // I have inserted this code for prevent memory leak !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    if( g_pdort_mut ){
    delete g_pdort_mut;
    g_pdort_mut = NULL;
    }
    }
    }
    return *g_pdort;
    }

    Is correct ? or can make problem ?

     
    • arst
      arst
      2009-04-25

      Hello,

      Thanks for your input, I've been busy, so catching up now.

      Being able to share dynamic objects across JAVA/.NET boundary would be great, and I think it could be done. ...but, not by me!

      Memleak?
      You want to destroy the global mutex. It should be automatically destroyed by DoRunTimeGlobConstr::~DoRunTimeGlobConstr().

      I know that C/C++ runtimes may fail to run global dtors sometimes.

      Or, if you have a mem leak tracker installed, it could run before all global dtors have been run.

      So, not a memory leak.

      // ATS.