[py] fix typo in sink docstrings
[aubio.git] / python / ext / py-sink.c
index e57a329..83c7ddd 100644 (file)
@@ -14,7 +14,7 @@ typedef struct
 static char Py_sink_doc[] = ""
 "sink(path, samplerate=44100, channels=1)\n"
 "\n"
-"Open `path` to write a WAV file.\n"
+"Write audio samples to file.\n"
 "\n"
 "Parameters\n"
 "----------\n"
@@ -81,7 +81,7 @@ static char Py_sink_close_doc[] = ""
 "Close this sink now.\n"
 "\n"
 "By default, the sink will be closed before being deleted.\n"
-"Explicitely closing a sink can be useful to control the number\n"
+"Explicitly closing a sink can be useful to control the number\n"
 "of files simultaneously opened.\n"
 "";
 
@@ -150,8 +150,10 @@ Py_sink_init (Py_sink * self, PyObject * args, PyObject * kwds)
 static void
 Py_sink_del (Py_sink *self, PyObject *unused)
 {
-  del_aubio_sink(self->o);
-  free(self->mwrite_data.data);
+  if (self->o) {
+    del_aubio_sink(self->o);
+    free(self->mwrite_data.data);
+  }
   if (self->uri) {
     free(self->uri);
   }