add free() method for stability on Windows
This commit is contained in:
@@ -163,6 +163,7 @@ FLUTTER_PLUGIN_EXPORT void set_post_processing(void* const viewer, bool enabled)
|
|||||||
FLUTTER_PLUGIN_EXPORT void pick(void* const viewer, int x, int y, EntityId* entityId);
|
FLUTTER_PLUGIN_EXPORT void pick(void* const viewer, int x, int y, EntityId* entityId);
|
||||||
FLUTTER_PLUGIN_EXPORT const char* get_name_for_entity(void* const assetManager, const EntityId entityId);
|
FLUTTER_PLUGIN_EXPORT const char* get_name_for_entity(void* const assetManager, const EntityId entityId);
|
||||||
FLUTTER_PLUGIN_EXPORT void ios_dummy();
|
FLUTTER_PLUGIN_EXPORT void ios_dummy();
|
||||||
|
FLUTTER_PLUGIN_EXPORT void flutter_filament_free(void* ptr);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -445,4 +445,11 @@ extern "C"
|
|||||||
{
|
{
|
||||||
Log("Dummy called");
|
Log("Dummy called");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FLUTTER_PLUGIN_EXPORT void flutter_filament_free(void* ptr)
|
||||||
|
{
|
||||||
|
free(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1015,7 +1015,7 @@ class FilamentControllerFFI extends FilamentController {
|
|||||||
|
|
||||||
var position = modelMatrix.getColumn(3).xyz;
|
var position = modelMatrix.getColumn(3).xyz;
|
||||||
|
|
||||||
calloc.free(arrayPtr);
|
flutter_filament_free(arrayPtr.cast<Void>());
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1029,7 +1029,7 @@ class FilamentControllerFFI extends FilamentController {
|
|||||||
var modelMatrix = Matrix4.fromFloat64List(doubleList);
|
var modelMatrix = Matrix4.fromFloat64List(doubleList);
|
||||||
var rotationMatrix = Matrix3.identity();
|
var rotationMatrix = Matrix3.identity();
|
||||||
modelMatrix.copyRotation(rotationMatrix);
|
modelMatrix.copyRotation(rotationMatrix);
|
||||||
calloc.free(arrayPtr);
|
flutter_filament_free(arrayPtr.cast<Void>());
|
||||||
return rotationMatrix;
|
return rotationMatrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user