Skip to content

Commit

Permalink
Remove the active bindings before the promises (tidyverse#6034)
Browse files Browse the repository at this point in the history
* swap order of env_unbind()s
  • Loading branch information
romainfrancois committed Sep 30, 2021
1 parent 93fe9ef commit 837bf5e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ SEXP dplyr_mask_remove(SEXP env_private, SEXP s_name) {
Rf_namesgets(new_current_data, new_current_vars);
Rf_defineVar(dplyr::symbols::current_data, new_current_data, env_private);

SEXP chops = PROTECT(Rf_findVarInFrame(env_private, dplyr::symbols::chops));
SEXP sym_name = PROTECT(rlang::str_as_symbol(name));
rlang::env_unbind(chops, sym_name);

SEXP chops = PROTECT(Rf_findVarInFrame(env_private, dplyr::symbols::chops));
SEXP mask = PROTECT(Rf_findVarInFrame(env_private, dplyr::symbols::mask));

rlang::env_unbind(ENCLOS(mask), sym_name);
rlang::env_unbind(chops, sym_name);

UNPROTECT(5);
}
Expand Down

0 comments on commit 837bf5e

Please sign in to comment.