Skip to content

Commit

Permalink
initialize indices with NULL - this should fix the null ptr exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed May 10, 2012
1 parent 717f885 commit c019459
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/shogun/machine/KernelMachine.cpp
Expand Up @@ -303,6 +303,8 @@ CLabels* CKernelMachine::apply()
params.start=0;
params.end=num_vectors;
params.verbose=true;
params.indices = NULL;
params.indices_len = 0;
apply_helper((void*) &params);
}
#ifdef HAVE_PTHREAD
Expand All @@ -321,6 +323,8 @@ CLabels* CKernelMachine::apply()
params[t].start = t*step;
params[t].end = (t+1)*step;
params[t].verbose = false;
params[t].indices = NULL;
params[t].indices_len = 0;
pthread_create(&threads[t], NULL,
CKernelMachine::apply_helper, (void*)&params[t]);
}
Expand All @@ -330,6 +334,8 @@ CLabels* CKernelMachine::apply()
params[t].start = t*step;
params[t].end = num_vectors;
params[t].verbose = true;
params[t].indices = NULL;
params[t].indices_len = 0;
apply_helper((void*) &params[t]);

for (t=0; t<num_threads-1; t++)
Expand Down

0 comments on commit c019459

Please sign in to comment.