Skip to content

Commit

Permalink
Avoid call through incompatible function pointer.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87513 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
kalibera committed Jan 2, 2025
1 parent ab69f59 commit 5307acb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 1998-2023 The R Core Team
* Copyright (C) 1998-2025 The R Core Team
* Copyright (C) 2002-2005 The R Foundation
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
*
Expand Down Expand Up @@ -1959,6 +1959,11 @@ R_taskCallbackRoutine(SEXP expr, SEXP value, Rboolean succeeded,
return(again);
}

static void releaseObjectFinalizer(void *data)
{
R_ReleaseObject((SEXP)data);
}

attribute_hidden SEXP
R_addTaskCallback(SEXP f, SEXP data, SEXP useData, SEXP name)
{
Expand All @@ -1978,7 +1983,7 @@ R_addTaskCallback(SEXP f, SEXP data, SEXP useData, SEXP name)

PROTECT(index = allocVector(INTSXP, 1));
el = Rf_addTaskCallback(R_taskCallbackRoutine, internalData,
(void (*)(void*)) R_ReleaseObject, tmpName,
releaseObjectFinalizer, tmpName,
INTEGER(index));

if(length(name) == 0) {
Expand Down

0 comments on commit 5307acb

Please sign in to comment.