mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
Don't leak exceptions
This commit is contained in:
parent
e6bd88878e
commit
b4edc3ca61
3 changed files with 48 additions and 9 deletions
|
@ -3,10 +3,14 @@
|
|||
|
||||
extern "C" std::exception_ptr * make_error(rust::StringSlice s)
|
||||
{
|
||||
// FIXME: leak
|
||||
return new std::exception_ptr(std::make_exception_ptr(nix::Error(std::string(s.ptr, s.size))));
|
||||
}
|
||||
|
||||
extern "C" void destroy_error(std::exception_ptr * ex)
|
||||
{
|
||||
free(ex);
|
||||
}
|
||||
|
||||
namespace rust {
|
||||
|
||||
std::ostream & operator << (std::ostream & str, const String & s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue