Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Commit

Permalink
OCDoResource: Initialize structure by assignment
Browse files Browse the repository at this point in the history
Fixes gh-3
Closes gh-4
  • Loading branch information
Gabriel Schulhof committed Jun 5, 2015
1 parent 561e217 commit cc98359
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/functions/oc-do-resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ NAN_METHOD(bind_OCDoResource) {

OCHeaderOption *options = 0;
OCDoHandle handle;
OCCallbackData data = {0, defaultOCClientResponseHandler,
(OCClientContextDeleter)persistentJSCallback_free};
OCCallbackData data;

VALIDATE_ARGUMENT_COUNT(args, 9);
VALIDATE_ARGUMENT_TYPE(args, 0, IsObject);
Expand All @@ -99,6 +98,8 @@ NAN_METHOD(bind_OCDoResource) {

data.context =
(void *)persistentJSCallback_new(Local<Function>::Cast(args[7]));
data.cb = defaultOCClientResponseHandler;
data.cd = (OCClientContextDeleter)persistentJSCallback_free;

if (args[8]->IsArray()) {
options = oc_header_options_new(Handle<Array>::Cast(args[8]));
Expand Down

0 comments on commit cc98359

Please sign in to comment.