Skip to content

Found a problem when using the same object in different objects #165

Description

@Manesx

Found a problem when using the same object in different objects

fjson_object *m = fjson_object_new_object();

    fjson_object *i = fjson_object_new_int(1);

    fjson_object *a = fjson_object_new_object();
    fjson_object_object_add(a, "i", i);

    fjson_object *b = fjson_object_new_object();
    fjson_object_object_add(b, "i", i);

    fjson_object_object_add(m, "a", a);
    fjson_object_object_add(m, "b", b);

    printf("%s\n", fjson_object_to_json_string_ext(m, FJSON_TO_STRING_PLAIN));
    fjson_object_put(m); // segmentation fault due to trying to delete one i in different objects

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions