[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenetwork/librss
From:       Frerich Raabe <raabe () kde ! org>
Date:       2003-06-17 1:02:37
[Download RAW message or body]

CVS commit by raabe: 

- It's not necessary to allocate a Private struct in the copy constructor, it
  would get overwritten in the assignment operator anyway.


  M +2 -2      article.cpp   1.8
  M +2 -2      image.cpp   1.8
  M +2 -2      textinput.cpp   1.7


--- kdenetwork/librss/article.cpp  #1.7:1.8
@@ -33,5 +33,5 @@ Article::Article() : d(new Private)
 }
 
-Article::Article(const Article &other) : d(new Private)
+Article::Article(const Article &other) : d(0)
 {
         *this = other;
@@ -85,5 +85,5 @@ Article &Article::operator=(const Articl
         if (this != &other) {
                 other.d->ref();
-                if (d->deref())
+                if (d && d->deref())
                         delete d;
                 d = other.d;

--- kdenetwork/librss/image.cpp  #1.7:1.8
@@ -41,5 +41,5 @@ Image::Image() : QObject(), d(new Privat
 }
 
-Image::Image(const Image &other) : QObject(), d(new Private)
+Image::Image(const Image &other) : QObject(), d(0)
 {
         *this = other;
@@ -135,5 +135,5 @@ Image &Image::operator=(const Image &oth
         if (this != &other) {
                 other.d->ref();
-                if (d->deref())
+                if (d && d->deref())
                         delete d;
                 d = other.d;

--- kdenetwork/librss/textinput.cpp  #1.6:1.7
@@ -33,5 +33,5 @@ TextInput::TextInput() : d(new Private)
 }
 
-TextInput::TextInput(const TextInput &other) : d(new Private)
+TextInput::TextInput(const TextInput &other) : d(0)
 {
         *this = other;
@@ -82,5 +82,5 @@ TextInput &TextInput::operator=(const Te
         if (this != &other) {
                 other.d->ref();
-                if (d->deref())
+                if (d && d->deref())
                         delete d;
                 d = other.d;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic