 		}
 	}
 	printf("done (%g seconds)\n", stop_timer());
-	delete []counts.data;
-	delete []indices.data;
-	delete []dists.data;
+	delete []counts.ptr();
+	delete []indices.ptr();
+	delete []dists.ptr();
 }
 
 TEST_F(Flann_3D, TestRadiusSearch)


    void TearDown()
    {
        delete[] data.data;
        delete[] query.data;
        delete[] match.data;
        delete[] dists.data;
        delete[] indices.data;
    }
};


	flann::Matrix<int> counts( new int[query.rows], query.rows,1);
	flann::Matrix<float> dummy( 0,0,0 );
	flann::SearchParams counting_params;
	counting_params.max_neighbors=0;
	start_timer("counting neighbors...");
	index.radiusSearch( query, counts,dists, r*r, counting_params );
	printf("done (%g seconds)", stop_timer());
