Browse files

fixed: some libuv API changes

  • Loading branch information...
1 parent f2f4850 commit bb062001366fe40c9c998bacb059116c13bdf4fe @mohayonao committed Dec 1, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 macaudio.cc
View
9 macaudio.cc
@@ -1,5 +1,6 @@
#include <v8.h>
#include <node.h>
+#include <node_version.h>
#include <uv.h>
#import <AudioUnit/AudioUnit.h>
@@ -152,7 +153,11 @@ class JSOutputNode : ObjectWrap {
if (node->_isPlaying) {
node->_isPlaying = false;
AudioOutputUnitStop(node->_audioUnit);
+#if NODE_VERSION_AT_LEAST(0, 7, 9)
+ uv_unref((uv_handle_t *)&scope);
+#else
uv_unref(uv_default_loop());
+#endif
}
return scope.Close(Undefined());
}
@@ -244,7 +249,11 @@ class JSOutputNode : ObjectWrap {
~JSOutputNode() {
if (_isPlaying) {
_isPlaying = false;
+#if NODE_VERSION_AT_LEAST(0, 7, 9)
+
+#else
uv_unref(uv_default_loop());
+#endif
}
for (uint i = 0; i < _channels; i++) {
delete _data[i];

0 comments on commit bb06200

Please sign in to comment.