[Openh323-devel] Serious API change in PTrace::SetStream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


I'm using an Asterisk with chan_h323 module which is based on openh323. 
After upgrading to pwlib 1.12 I started to experience crashes during 
loading and unloading that module. The problem isn't stopper but is 
quite annoying so I've made an investigation and found out that the 
crash occurs in the following code:

          if (logstream) {
                delete logstream; // APPLICATION CRASHES HERE
                logstream = NULL;

And here is the code from PTraceInfo::SetStream:

        void SetStream(ostream * newStream)
            if (stream != &cerr && stream != &cout)
                delete stream;
            stream = newStream;

However the pwlib prior 1.12.0 didn't delete the old stream:

        void PTrace::SetStream(ostream * s)
        #ifndef __NUCLEUS_PLUS__
          if (s == NULL)
            s = &cerr;

          if (PTraceMutex == NULL)
            PTraceStream = s;
          else {
            PWaitAndSignal m(*PTraceMutex);
            PTraceStream = s;

IMHO this API change is too serious to be allowed without any 
compatibility shims.

  Kind regards,
  Andriy Pylypenko

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Openh323-devel mailing list

[Open H.323]     [IETF SIP]     [Gnu Gatekeeper]     [Asterisk PBX]     [Fedora Linux]     [Gimp]     [Yosemite News]     [Yosemite Photos]     [Yosemite Campsites]     [ISDN Cause Codes]

Add to Google Powered by Linux