Skip to content

Commit

Permalink
Revert freeing memory until the lifecycle of that memory is better un…
Browse files Browse the repository at this point in the history
…derstood.
  • Loading branch information
Danack committed Jul 1, 2024
1 parent c0a9aba commit bede781
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion imagickkernel_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ PHP_METHOD(ImagickKernel, fromMatrix)
kernel_info = imagick_createKernel(values, num_columns, num_rows, origin_x, origin_y);
createKernelZval(return_value, kernel_info TSRMLS_CC);

// The values are still used here, as free'ing them causes problems
return;

cleanup:
if (values != NULL) {
RelinquishAlignedMemory(values);
Expand Down Expand Up @@ -758,7 +761,9 @@ PHP_METHOD(ImagickKernel, separate)
kernel_info->x,
kernel_info->y
);
RelinquishAlignedMemory(values_copy);

// The values are still used here, as free'ing them causes problems
// RelinquishAlignedMemory(values_copy);

#if PHP_VERSION_ID >= 70000
createKernelZval(&separate_object, kernel_info_copy TSRMLS_CC);
Expand Down

0 comments on commit bede781

Please sign in to comment.