| 1945 | } |
| 1946 | |
| 1947 | Value::~Value() { |
| 1948 | switch (type_) { |
| 1949 | case nullValue: |
| 1950 | case intValue: |
| 1951 | case uintValue: |
| 1952 | case realValue: |
| 1953 | case booleanValue: |
| 1954 | break; |
| 1955 | case stringValue: |
| 1956 | if (allocated_) |
| 1957 | releaseStringValue(value_.string_); |
| 1958 | break; |
| 1959 | #ifndef JSON_VALUE_USE_INTERNAL_MAP |
| 1960 | case arrayValue: |
| 1961 | case objectValue: |
| 1962 | delete value_.map_; |
| 1963 | break; |
| 1964 | #else |
| 1965 | case arrayValue: |
| 1966 | arrayAllocator()->destructArray(value_.array_); |
| 1967 | break; |
| 1968 | case objectValue: |
| 1969 | mapAllocator()->destructMap(value_.map_); |
| 1970 | break; |
| 1971 | #endif |
| 1972 | default: |
| 1973 | JSON_ASSERT_UNREACHABLE; |
| 1974 | } |
| 1975 | |
| 1976 | if (comments_) |
| 1977 | delete[] comments_; |
| 1978 | } |
| 1979 | |
| 1980 | Value &Value::operator=(const Value &other) { |
| 1981 | Value temp(other); |
nothing calls this directly
no test coverage detected