mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +00:00
fix: replace free() with std::free() (#3321)
* Disambiguate free() to use std::free() * Add cstdlib include
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <catch.hpp>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
@@ -315,7 +316,7 @@ TEST_CASE("sys.argv gets initialized properly") {
|
||||
{
|
||||
char *argv[] = {strdup("a.out")};
|
||||
py::scoped_interpreter argv_scope(true, 1, argv);
|
||||
free(argv[0]);
|
||||
std::free(argv[0]);
|
||||
auto module = py::module::import("test_interpreter");
|
||||
auto py_widget = module.attr("DerivedWidget")("The question");
|
||||
const auto &cpp_widget = py_widget.cast<const Widget &>();
|
||||
|
||||
Reference in New Issue
Block a user