Changeset 16192
- Timestamp:
- 04/23/08 12:58:24 (6 months ago)
- Files:
-
- trunk/midgard/apis/php5/midgard.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midgard/apis/php5/midgard.c
r16186 r16192 380 380 } 381 381 382 static void __free_connections(gpointer key, gpointer val, gpointer ud) 383 { 384 MidgardConnection *cnc = MIDGARD_CONNECTION(val); 385 g_object_unref(cnc); 386 } 387 382 388 PHP_MSHUTDOWN_FUNCTION(midgard2) 383 389 { 384 /* Remove comments if you have entries in php.ini 385 * UNREGISTER_INI_ENTRIES(); 386 * */ 390 391 UNREGISTER_INI_ENTRIES(); 387 392 388 393 /* Free schema */ … … 390 395 g_object_unref(midgard_global_schema); 391 396 392 /* Free connection */ 393 MidgardConnection *mgd = mgd_handle(); 394 if(mgd != NULL) 395 g_warning("midgard_close() not yet implemented"); 397 /* Free connections */ 398 if(all_configs != NULL) { 399 400 g_hash_table_foreach(all_configs, __free_connections, NULL); 401 402 } else { 403 404 MidgardConnection *mgd = mgd_handle(); 405 if(mgd != NULL) 406 g_object_unref(mgd); 407 } 396 408 397 409 return SUCCESS; … … 471 483 MidgardConnection *cnc = 472 484 (MidgardConnection *) g_hash_table_lookup(all_configs, config); 473 485 474 486 /* Try to connect */ 475 487 if(cnc == NULL) { … … 480 492 481 493 g_debug("Found connection handler for '%s'", config); 482 MGDG(mgd) = cnc; 494 MGDG(mgd) = midgard_connection_copy(cnc); 495 inherited_cnc = cnc; 483 496 } 484 497 … … 528 541 if(mgd != NULL){ 529 542 530 /* TODO531 * unref MidgardConnection object532 * make sure person and request is also unref'ed */533 543 534 544 /* FIXME , replace with MidgardConnection API */ … … 552 562 midgard_connection_get_loghandler(inherited_cnc)); 553 563 554 //g_object_unref(inherited_cnc);564 g_object_unref(inherited_cnc); 555 565 inherited_cnc = NULL; 556 566 }
