Fixed minor c++ issues found by cppcheck

http://codereview.appspot.com/6127049/



git-svn-id: http://skia.googlecode.com/svn/trunk@3771 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2012-04-27 12:54:01 +00:00
parent 725a295c50
commit 05141c23ed
5 changed files with 14 additions and 5 deletions

View File

@ -24,7 +24,7 @@
class SkSocket {
public:
SkSocket();
~SkSocket();
virtual ~SkSocket();
enum State {
kError_state,
@ -152,7 +152,7 @@ protected:
class SkTCPServer : public SkSocket {
public:
SkTCPServer(int port = DEFAULT_PORT);
~SkTCPServer();
virtual ~SkTCPServer();
/**
* Accept any incoming connections to the server, will accept 1 connection

View File

@ -303,7 +303,7 @@ public:
class SkPDFFunctionShader : public SkPDFDict, public SkPDFShader {
public:
explicit SkPDFFunctionShader(SkPDFShader::State* state);
~SkPDFFunctionShader() {
virtual ~SkPDFFunctionShader() {
if (isValid()) {
RemoveShader(this);
}
@ -328,7 +328,7 @@ private:
class SkPDFImageShader : public SkPDFStream, public SkPDFShader {
public:
explicit SkPDFImageShader(SkPDFShader::State* state);
~SkPDFImageShader() {
virtual ~SkPDFImageShader() {
RemoveShader(this);
fResources.unrefAll();
}

View File

@ -60,6 +60,7 @@ protected:
static void RemoveShader(SkPDFObject* shader);
SkPDFShader();
virtual ~SkPDFShader() {};
virtual bool isValid() = 0;
};

View File

@ -42,3 +42,6 @@ The following changes were made in order to incorporate this code:
- In sweep.c, added explicit cast to GLfloat in VertexWeights() to silence
compiler complaint
- In mesh.c in method __gl_meshMakeEdge, added memory cleanup when
MakeEdge failed

View File

@ -291,7 +291,12 @@ GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh )
}
e = MakeEdge( &mesh->eHead );
if (e == NULL) return NULL;
if (e == NULL) {
memFree(newVertex1);
memFree(newVertex2);
memFree(newFace);
return NULL;
}
MakeVertex( newVertex1, e, &mesh->vHead );
MakeVertex( newVertex2, e->Sym, &mesh->vHead );