| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Some properties were being set on the libgit2 C struct but would be destroyed after the function is completed. The problem was that C struct would still assume that the memory it had was valid and would try to use it resulting in random segfaults. Now you can mark an argument as `saveArg` and then that argument will be persisted to the parent object and disposed of when the parent is deleted. Currently this only works in sync functions since I couldn't find an async method that would need this. If this changes it shouldn't be too hard to implement. Another thing to note is that the if the parent object is marked as `!selfFreeing` then we're still going to dispose of the persisted objects because if not then they will memory leak all over the place. This might need to be looked into more later. I currently couldn't find a situation where this would happen but the code is pretty complicated at this point and I certainly could have missed something
Sorry, something went wrong.
Allow for saving of props to an object
| Back | FazBrowse Home | New Git URL |
Some properties were being set on the libgit2 C struct but would
be destroyed after the function is completed. The problem was that
C struct would still assume that the memory it had was valid and
would try to use it resulting in random segfaults.
Now you can mark an argument as saveArg and then that argument
will be persisted to the parent object and disposed of when the
parent is deleted.
Currently this only works in sync functions since I couldn't find
an async method that would need this. If this changes it shouldn't
be too hard to implement.
Another thing to note is that the if the parent object is marked
as !selfFreeing then we're still going to dispose of the
persisted objects because if not then they will memory leak all
over the place. This might need to be looked into more later. I
currently couldn't find a situation where this would happen but
the code is pretty complicated at this point and I certainly could
have missed something