Uploaded image for project: 'Qt Solutions'
  1. Qt Solutions
  2. QTSOLBUG-177

Possible memory leak in QtSmartPtr

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Next Major Release
    • SOAP
    • None

    Description

      In qtsoap.h:

          inline QtSmartPtr(T *data = 0)
          {
          d = data;
          r = new int;
          *r = 1;
          }
      
          inline QtSmartPtr(const QtSmartPtr &copy)
          {
          if (*copy.r != 0)
              ++(*copy.r);
       
          r = copy.r;
          d = copy.d;
          }
      

      In copy constructor:
      r = copy.r;
      But before is not freed. Memory allocated in constructor:
      r = new int;

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            mcoder Konstantin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes