-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmemory_test.c
More file actions
46 lines (34 loc) · 1.27 KB
/
memory_test.c
File metadata and controls
46 lines (34 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "ariel.h"
#include <stdio.h>
#include <stdlib.h>
// Minimal test to reproduce memory corruption without full UI
int main() {
printf("Starting memory corruption test\n");
// Initialize GTK (minimal)
gtk_init();
// Create ArielApp
ArielApp *app = ariel_app_new();
if (!app) {
printf("Failed to create ArielApp\n");
return 1;
}
printf("ArielApp created at: %p\n", (void*)app);
// Create a mock window structure
ArielWindow *window = g_malloc0(sizeof(ArielWindow));
window->app = app;
printf("Window created at: %p, window->app = %p\n", (void*)window, (void*)window->app);
// Test ariel_app_get_plugin_manager call
printf("About to call ariel_app_get_plugin_manager...\n");
ArielApp *app_before = window->app;
ArielPluginManager *pm = ariel_app_get_plugin_manager(window->app);
printf("ariel_app_get_plugin_manager returned: %p\n", (void*)pm);
printf("window->app after call: %p (was %p)\n", (void*)window->app, (void*)app_before);
if (window->app != app_before) {
printf("MEMORY CORRUPTION DETECTED!\n");
} else {
printf("No memory corruption detected\n");
}
g_free(window);
g_object_unref(app);
return 0;
}