mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Fixed memory leak in AssetFile
This commit is contained in:
@@ -26,9 +26,9 @@ class AssetFile
|
|||||||
{
|
{
|
||||||
private EditorContentManager _contentManager;
|
private EditorContentManager _contentManager;
|
||||||
|
|
||||||
private String _path;
|
private String _path ~ delete:append _;
|
||||||
private String _identifier;
|
private String _identifier ~ delete:append _;
|
||||||
private String _assetConfigPath ~ delete _;
|
private String _assetConfigPath ~ delete:append _;
|
||||||
|
|
||||||
private AssetConfig _assetConfig ~ delete _;
|
private AssetConfig _assetConfig ~ delete _;
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class AssetFile
|
|||||||
{
|
{
|
||||||
String identifierBuffer = append String(identifier);
|
String identifierBuffer = append String(identifier);
|
||||||
String pathBuffer = append String(path);
|
String pathBuffer = append String(path);
|
||||||
String configPathBuffer = new String(path.Length + ConfigFileExtension.Length);
|
String configPathBuffer = append String(path.Length + ConfigFileExtension.Length);
|
||||||
|
|
||||||
_identifier = identifierBuffer;
|
_identifier = identifierBuffer;
|
||||||
_path = pathBuffer;
|
_path = pathBuffer;
|
||||||
|
|||||||
@@ -673,14 +673,12 @@ class AssetHierarchy
|
|||||||
// Directories have no AssetFile?
|
// Directories have no AssetFile?
|
||||||
if (node->AssetFile != null)
|
if (node->AssetFile != null)
|
||||||
{
|
{
|
||||||
// TODO: Somehow this leaks memory
|
|
||||||
node->AssetFile.[Friend]_path.Set(node->Path);
|
node->AssetFile.[Friend]_path.Set(node->Path);
|
||||||
|
|
||||||
node->AssetFile.[Friend]_identifier.Set(newFilePath);
|
node->AssetFile.[Friend]_identifier.Set(newFilePath);
|
||||||
AssetIdentifier.Fixup(node->AssetFile.[Friend]_identifier);
|
AssetIdentifier.Fixup(node->AssetFile.[Friend]_identifier);
|
||||||
|
|
||||||
node->AssetFile.[Friend]_assetConfigPath.Set(node->Path);
|
node->AssetFile.[Friend]_assetConfigPath.Set(node->Path);
|
||||||
// TODO: Somehow this leaks memory
|
|
||||||
node->AssetFile.[Friend]_assetConfigPath.Append(AssetFile.ConfigFileExtension);
|
node->AssetFile.[Friend]_assetConfigPath.Append(AssetFile.ConfigFileExtension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user