22 g_autoptr(GError)
error =
nullptr;
23 g_autofree gchar* exe_path = g_file_read_link(
"/proc/self/exe", &
error);
24 if (exe_path ==
nullptr) {
25 g_critical(
"Failed to determine location of executable: %s",
30 return g_path_get_dirname(exe_path);
34 FlDartProject*
self = FL_DART_PROJECT(
object);
36 g_clear_pointer(&self->aot_library_path, g_free);
37 g_clear_pointer(&self->assets_path, g_free);
38 g_clear_pointer(&self->icu_data_path, g_free);
39 g_clear_pointer(&self->dart_entrypoint_args, g_strfreev);
41 G_OBJECT_CLASS(fl_dart_project_parent_class)->dispose(
object);
52 FL_DART_PROJECT(g_object_new(fl_dart_project_get_type(),
nullptr));
55 self->aot_library_path =
56 g_build_filename(executable_dir,
"lib",
"libapp.so",
nullptr);
58 g_build_filename(executable_dir,
"data",
"flutter_assets",
nullptr);
60 g_build_filename(executable_dir,
"data",
"icudtl.dat",
nullptr);
67 g_return_if_fail(FL_IS_DART_PROJECT(
self));
68 g_clear_pointer(&self->aot_library_path, g_free);
69 self->aot_library_path = g_strdup(path);
73 FlDartProject*
self) {
74 g_return_val_if_fail(FL_IS_DART_PROJECT(
self),
nullptr);
75 return self->aot_library_path;
80 g_return_if_fail(FL_IS_DART_PROJECT(
self));
81 g_clear_pointer(&self->assets_path, g_free);
82 self->assets_path = g_strdup(path);
86 FlDartProject*
self) {
87 g_return_val_if_fail(FL_IS_DART_PROJECT(
self),
nullptr);
88 return self->assets_path;
93 g_return_if_fail(FL_IS_DART_PROJECT(
self));
94 g_clear_pointer(&self->icu_data_path, g_free);
95 self->icu_data_path = g_strdup(path);
99 FlDartProject*
self) {
100 g_return_val_if_fail(FL_IS_DART_PROJECT(
self),
nullptr);
101 return self->icu_data_path;
105 FlDartProject*
self) {
106 g_return_val_if_fail(FL_IS_DART_PROJECT(
self),
nullptr);
107 return self->dart_entrypoint_args;
113 g_return_if_fail(FL_IS_DART_PROJECT(
self));
114 g_clear_pointer(&self->dart_entrypoint_args, g_strfreev);
115 self->dart_entrypoint_args = g_strdupv(argv);