Summary: | KSnake graphics are horrible in KDE 3.1.92 | ||
---|---|---|---|
Product: | [Applications] ksnake | Reporter: | Albert Astals Cid <aacid> |
Component: | general | Assignee: | Andrew Chant <achant> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 0.3.1 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Albert Astals Cid
2003-10-02 22:57:03 UTC
Subject: kdegames/ksnake CVS commit by aacid: Using BarIcon to load icons that are not bar icons is VERY BAD, that fixes bug #65401, fixing my own bugs makes me fell better 8-) Some cleaning at ball.cpp and ball.h, remove empty destructors, use polimorphism and inheritance to remove DumbKillerBall::nextMove() as its code was the same as KillerBall::nextMove() except one line CCMAIL:65401-done@bugs.kde.org M +8 -28 ball.cpp 1.4 M +7 -7 ball.h 1.5 M +5 -5 pixServer.cpp 1.22 M +2 -1 trys.cpp 1.11 dude - I think you made a bad mistake taking out the destructor. If you make the class virtual, then you really should make the destructor virtual as well, especially if you are using polymorphism! Otherwise you are just looking for some bad memory problems. please put it back in. I don't think so (i can be wrong of course). First, ALL the destructors were empty, even the base class Ball had an empty destructor. Second, even if you don't define the destructor, it is called(see http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.1 it says "A class's destructor (whether or not you explicitly define one) automagically invokes the destructors for member objects.") Third, there is not any object creation in ball.cpp (i mean "new foo"), so why do we need destructors? As i said, i can be wrong, but if i am wrong could you care to explain why so the next time i won't have the same error. Uhh, found that "make your destructor virtual if your class has any virtual functions" at http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.5 I've changed the code and i've added a virtual empty destructor to Ball and to KillerBall. Do you think it's fine now? Albert. |