L
L
LittleBuster2016-01-07 20:12:38
C++ / C#
LittleBuster, 2016-01-07 20:12:38

Why does json_decref cause a crash on Windows?

I use the Jansson library downloaded from off site. The problem occurs only on Windows, the same sections of code on Linux work flawlessly.

json_t *root = /* some code */

json_t *jdata, *jobj;

jdata = json_array_get(json_cfg.root, section);
jobj = json_object_get(jdata, subsection);

    for (size_t i = 0; i < sz_p; i++) {
        json_t *jsub_obj = json_object_get(jobj, params[i].name);
       /* some code */
        json_decref(jsub_obj); //<<-- нормально работает на Linux && Windows
    }
json_decref(jobj);  //<<--- WIN32:  аварийный останов core dumped
json_decref(jdata); //<<----- WIN32: аварийный останов core dumped

json_decref(root); //<<--------WIN32: аварийный останов core dumped

Can I replace with free () or not, otherwise it does not cause errors?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question